aboutsummaryrefslogblamecommitdiff
path: root/tests/untried/pos/t5958.scala
blob: 3e078d2aaea97c63bd6ddf5188a7d70e77972e66 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                                    
class Test {
  def newComponent(u: Universe): u.Component = ???

  class Universe { self =>
    class Component

    newComponent(this): this.Component // error, but should be fine since this is a stable reference
    newComponent(self): self.Component // error, but should be fine since this is a stable reference
    newComponent(self): this.Component // error, but should be fine since this is a stable reference
    newComponent(this): self.Component // error, but should be fine since this is a stable reference

    val u = this
    newComponent(u): u.Component // ok
  }
}