aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/t5958.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/pos/t5958.scala')
-rw-r--r--tests/untried/pos/t5958.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/untried/pos/t5958.scala b/tests/untried/pos/t5958.scala
new file mode 100644
index 000000000..3e078d2aa
--- /dev/null
+++ b/tests/untried/pos/t5958.scala
@@ -0,0 +1,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
+ }
+}