aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-01-01 13:45:08 +0100
committerMartin Odersky <odersky@gmail.com>2015-01-01 13:45:16 +0100
commite3a43806a2b5b17982e942a82cabe139c09d971e (patch)
tree2e4ab893c1a0a640d6933df4bc50dd785fb8a63d /tests
parente50f47c17eea3aee80db2d86e28e7ae016f94cbb (diff)
downloaddotty-e3a43806a2b5b17982e942a82cabe139c09d971e.tar.gz
dotty-e3a43806a2b5b17982e942a82cabe139c09d971e.tar.bz2
dotty-e3a43806a2b5b17982e942a82cabe139c09d971e.zip
Reorg of subtyping.
Plus, RefinedThis gets a second parameter, `level`. This will replace the first one in due time.
Diffstat (limited to 'tests')
-rw-r--r--tests/pending/pos/compound.scala4
-rw-r--r--tests/pending/pos/subtypcycle.scala10
-rw-r--r--tests/pos/Patterns.scala2
-rw-r--r--tests/pos/refinedSubtyping.scala11
4 files changed, 26 insertions, 1 deletions
diff --git a/tests/pending/pos/compound.scala b/tests/pending/pos/compound.scala
index 60890f910..308ffdfd9 100644
--- a/tests/pending/pos/compound.scala
+++ b/tests/pending/pos/compound.scala
@@ -7,3 +7,7 @@ abstract class Test {
var xx: A with B { type T; val xz: T } = null;
xx = yy;
}
+abstract class Test2 {
+ var yy: A with B { type T; val xz: T } = null;
+ val xx: A with B { type T; val xz: T } = yy
+}
diff --git a/tests/pending/pos/subtypcycle.scala b/tests/pending/pos/subtypcycle.scala
new file mode 100644
index 000000000..76eb7ffec
--- /dev/null
+++ b/tests/pending/pos/subtypcycle.scala
@@ -0,0 +1,10 @@
+object subtypcycle {
+ trait Y {
+ type A <: { type T >: B }
+ type B >: { type T >: A }
+ }
+
+ val y: Y = ???
+ val a: y.A = ???
+ val b: y.B = a
+}
diff --git a/tests/pos/Patterns.scala b/tests/pos/Patterns.scala
index 54c4d8ab2..98af1cddb 100644
--- a/tests/pos/Patterns.scala
+++ b/tests/pos/Patterns.scala
@@ -6,7 +6,7 @@ object Patterns {
private def rebase(tp: NamedType): Type = {
def rebaseFrom(prefix: Type): Type = ???
tp.prefix match {
- case RefinedThis(rt) => rebaseFrom(rt)
+ case RefinedThis(rt, _) => rebaseFrom(rt)
case pre: ThisType => rebaseFrom(pre)
case _ => tp
}
diff --git a/tests/pos/refinedSubtyping.scala b/tests/pos/refinedSubtyping.scala
index a01be181d..329c62314 100644
--- a/tests/pos/refinedSubtyping.scala
+++ b/tests/pos/refinedSubtyping.scala
@@ -60,3 +60,14 @@ class Test3 {
y = x
}
+/* Does not work yet:
+class Test4 {
+
+ abstract class A { type T; val xz: Any }
+
+ val yy: A { val xz: T } = null;
+// val xx: A { val xz: T } = null;
+ val zz: A { val xz: T } = yy;
+
+}
+*/