summaryrefslogtreecommitdiff
path: root/test/files/neg/t7834neg.check
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/neg/t7834neg.check
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/neg/t7834neg.check')
-rw-r--r--test/files/neg/t7834neg.check41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/files/neg/t7834neg.check b/test/files/neg/t7834neg.check
new file mode 100644
index 0000000000..569df4b8ce
--- /dev/null
+++ b/test/files/neg/t7834neg.check
@@ -0,0 +1,41 @@
+t7834neg.scala:48: error: type mismatch;
+ found : C.super.q.type (with underlying type M2)
+ required: C.super.q.type
+ x1 = x2 // fail
+ ^
+t7834neg.scala:50: error: type mismatch;
+ found : C.super.q.type (with underlying type M1)
+ required: C.super.q.type
+ x2 = x1 // fail
+ ^
+t7834neg.scala:53: error: type mismatch;
+ found : C.super.q.type (with underlying type M1)
+ required: C.this.q.type
+ x3 = x1 // fail
+ ^
+t7834neg.scala:54: error: type mismatch;
+ found : C.super.q.type (with underlying type M2)
+ required: C.this.q.type
+ x3 = x2 // fail
+ ^
+t7834neg.scala:69: error: type mismatch;
+ found : C.super.q.type (with underlying type M2)
+ required: C.super.q.type
+ x1 = super[S2].q // fail
+ ^
+t7834neg.scala:71: error: type mismatch;
+ found : C.super.q.type (with underlying type M1)
+ required: C.super.q.type
+ x2 = super[S1].q // fail
+ ^
+t7834neg.scala:74: error: type mismatch;
+ found : C.super.q.type (with underlying type M1)
+ required: C.this.q.type
+ x3 = super[S1].q // fail
+ ^
+t7834neg.scala:75: error: type mismatch;
+ found : C.super.q.type (with underlying type M2)
+ required: C.this.q.type
+ x3 = super[S2].q // fail
+ ^
+8 errors found