aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/leaks.scala
blob: 0431c18ce7501579c0d89da1fd4961348de9c58f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Outer {
  private val x: Int = 1

  class Inner {
    def foo: x.type = x // error: non-private method foo refers to private value x in its type signature
  }
}

class Outer3Neg {
  def meth: Unit = {
    class Inner {
      private val x: Int = 1
      def foo: x.type = x // error
    }
  }
}