summaryrefslogtreecommitdiff
path: root/test/files/pos/t5958.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/t5958.scala')
-rw-r--r--test/files/pos/t5958.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/pos/t5958.scala b/test/files/pos/t5958.scala
new file mode 100644
index 0000000000..b7eb8cf8df
--- /dev/null
+++ b/test/files/pos/t5958.scala
@@ -0,0 +1,15 @@
+class Test {
+ def newComponent(u: Universe): u.Component = throw new Exception("not implemented")
+
+ 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
+ }
+}