class S {
case class A(a: Int)
}
abstract class R(val s: S) {
type T1 = R.this.s.A
type T2 = s.A
implicitly[T1 =:= T2] // compiles
type T3 = R.this.type
type T4 = this.type
implicitly[T3 =:= T4] // compiles
val v1 = R.this // v1 == `this`
val v2 = R.this.s // v2 == `s`
}
Looks like the .this part has no effect whatsoever. To make a concrete question:
When do you use the .this ?
It matters for inner classes. E.g.
Each
Outer.Innerinstances "belongs to" a specificOuterinstance, and can refer to that instance asOuter.this. By itselfxinInnerrefers to its own property, so if you need the enclosing instance'sxproperty, you writeOuter.this.x.