summaryrefslogblamecommitdiff
path: root/test/files/pos/t5958.scala
blob: 3b910f3633f4a73537d7e4eed3ffd0397ff9dc31 (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
  }
}