summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-07-28 20:02:02 -0700
committerPaul Phillips <paulp@improving.org>2012-07-28 20:02:02 -0700
commit4db27fc4676995c422c0964e27d305f0264e1389 (patch)
tree61232183ec73158a6f530fefa5e480bb9cc644b6 /test
parent5988121127ec17e4cc76dd49bc7847fc56a08336 (diff)
parentae28472bc727b25040da4b1428fcb14137d01102 (diff)
downloadscala-4db27fc4676995c422c0964e27d305f0264e1389.tar.gz
scala-4db27fc4676995c422c0964e27d305f0264e1389.tar.bz2
scala-4db27fc4676995c422c0964e27d305f0264e1389.zip
Merge pull request #991 from adriaanm/ticket-5958
SI-5958 This deserves a stable type
Diffstat (limited to 'test')
-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..3b910f3633
--- /dev/null
+++ b/test/files/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
+ }
+} \ No newline at end of file