Skip to content

Private type member leaks in public signature through match type #20194

Open
@EugeneFlesselle

Description

@EugeneFlesselle

Compiler version

3.5.0-RC1

Minimized code

type Aux[m] = A {type M = m}
type Leak[a] = a match
  case Aux[m] => m

trait A:
  private type M
  def m: Leak[this.type]

def foo(a: A{type M = Int}): Int = a.m

Output

Compiles without errors.

Expectation

I expected an error like a non-private method refers to a private type in its signature.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions