aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/leaks.scala
blob: 3fe029c75865f004c6e2b9ac6975038d75005387 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class Outer1 {
  private val x: Int = 1

  private class Inner {
    def foo: x.type = x // OK
  }
}

object Outer2 {
  private val x: Int = 1
}

class Outer2 {
  private class Inner {
    def foo: Outer2.x.type = Outer2.x // OK
  }
}

class Outer3 {
  private val x: Int = 1

  def meth: Unit = {
    class Inner {
      def foo: x.type = x // OK
    }
  }
}