Closed
Description
Compiler version
Scala 2 and Scala 3 (master)
Minimized code
class B(val y: Int):
println(this.y)
foo()
def foo() = println(this.y)
class C(override val y: Int) extends B(10)
@main
def Test = new C(20)
Output
10
20
Expectation
I would expect this.y
to have the same semantics both in the class body and method body.
It's up to discussion whether an unqualified y
in class body and in method body should have the same semantics.