summaryrefslogtreecommitdiff
path: root/test/files/pos/t7520.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-05-31 03:55:46 -0700
committerPaul Phillips <paulp@improving.org>2013-05-31 04:34:31 -0700
commit3c21aa38731b5011d09207e106918e16ded8ff98 (patch)
treeb747e33cebf671af969c8c0ea77334cc16414e3d /test/files/pos/t7520.scala
parentbcd052c029129129c2364327e79c4d66eb6193ee (diff)
downloadscala-3c21aa38731b5011d09207e106918e16ded8ff98.tar.gz
scala-3c21aa38731b5011d09207e106918e16ded8ff98.tar.bz2
scala-3c21aa38731b5011d09207e106918e16ded8ff98.zip
SI-7520 bug in subtyping.
isSubType, if given two SingleTypes, would check =:= and stop there. It is necessary to continue with weakening the left hand side, because (for instance) the singleton type on the left hand side could be a refinement class carrying parents which are themselves single or constant types.
Diffstat (limited to 'test/files/pos/t7520.scala')
-rw-r--r--test/files/pos/t7520.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/pos/t7520.scala b/test/files/pos/t7520.scala
new file mode 100644
index 0000000000..747f5278e5
--- /dev/null
+++ b/test/files/pos/t7520.scala
@@ -0,0 +1,10 @@
+class A {
+ val x: Singleton with this.type = this
+ val y: this.type = x
+}
+
+class B {
+ val x = ""
+ val xs: x.type with Singleton = x
+ val y: x.type = xs
+}