summaryrefslogtreecommitdiff
path: root/test/files/pos/t7834.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-09-11 10:17:56 -0700
committerPaul Phillips <paulp@improving.org>2013-09-11 12:18:41 -0700
commit92bd4a75eb546565df903793fe52b35c9159d1d6 (patch)
tree352b66d53ff26a8df129146d71047749d0761f65 /test/files/pos/t7834.scala
parent9788e7a1f1809491154c2bcb47d3061b11c1d8a8 (diff)
downloadscala-92bd4a75eb546565df903793fe52b35c9159d1d6.tar.gz
scala-92bd4a75eb546565df903793fe52b35c9159d1d6.tar.bz2
scala-92bd4a75eb546565df903793fe52b35c9159d1d6.zip
SI-7834 Type equivalence of C.this and C.super.
Foo.this.x and Foo.super.x were roughly unrelated in the eyes of isSubType. I implemented conformance as described in the comment: This is looking for situations such as B.this.x.type <:< B.super.x.type. If it's a ThisType on the lhs and a SuperType on the right, and they originate in the same class, and the 'x' in the ThisType has in its override chain the 'x' in the SuperType, then the types conform. I think this is overly conservative but it's way ahead of where it was.
Diffstat (limited to 'test/files/pos/t7834.scala')
-rw-r--r--test/files/pos/t7834.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/files/pos/t7834.scala b/test/files/pos/t7834.scala
new file mode 100644
index 0000000000..fc9a0aa09d
--- /dev/null
+++ b/test/files/pos/t7834.scala
@@ -0,0 +1,6 @@
+class S { val q = "" }
+
+class B extends S {
+ val x1: B.super.q.type = q
+ val x2: B.this.q.type = q
+}