1 2 3 4 5 6 7 8 9 10 11 12
class A { private val x = List(1,2) val elem = x.head } class B extends A { val a: Int = elem // Without `checkNoPrivateLeaks`, we get: // found: B.this.x.scala$collection$immutable$List$$A(B.this.elem) // required: Int }