aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/leak-inferred.scala
blob: 5d8a7e3bc3c47ca839b7ad0497b3298374050968 (plain) (blame)
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
}