Skip to content

leaking of local parameter of dependent method type #7084

Open
@scabug

Description

@scabug
object Test {
  trait A { a =>
    type X
    val x: a.X
  }
  val a = new A {
    type X = Int
    val x = 1
  }
  def f(arg: A): arg.X = arg.x
  val x = f(a: A)
}

snippet from -Xprint:typer:

...
    private[this] val x: arg.X = Test.this.f((Test.this.a: Test.A));
    <stable> <accessor> def x: arg.X = Test.this.x
...

arg is not in scope...

I don't know yet how to turn this into a true soundness issue, but it's weird.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions