## Compiler version Scala 2 and Scala 3 (master) ## Minimized code <!-- This code should be self contained, compilable (with possible failures) and as small as possible. Ideally, we should be able to just copy this code in a file and run `scalac` (and maybe `scala`) to reproduce the issue. --> ```Scala 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 ```scala 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.