summaryrefslogtreecommitdiff
path: root/test/files/pos/t0764.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-12 17:47:54 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-12 17:47:54 -0800
commit9c4a6e3ed7624892f46948c1c0fb57d7d5b3346e (patch)
treeb4b6d8fcedd45a8304d44c0dca3fe39a07fae065 /test/files/pos/t0764.scala
parent2240464dea5b13a487938f66878e3e84b180376a (diff)
parent427b82648422e4118c68f34e81c94deca3755deb (diff)
downloadscala-9c4a6e3ed7624892f46948c1c0fb57d7d5b3346e.tar.gz
scala-9c4a6e3ed7624892f46948c1c0fb57d7d5b3346e.tar.bz2
scala-9c4a6e3ed7624892f46948c1c0fb57d7d5b3346e.zip
Merge pull request #3516 from adriaanm/t8177
SI-8177 co-evolve more than just RefinedTypes
Diffstat (limited to 'test/files/pos/t0764.scala')
-rw-r--r--test/files/pos/t0764.scala27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/files/pos/t0764.scala b/test/files/pos/t0764.scala
new file mode 100644
index 0000000000..f1084f5ff8
--- /dev/null
+++ b/test/files/pos/t0764.scala
@@ -0,0 +1,27 @@
+class Top[A] {
+ type AType = A
+}
+
+trait Node { outer =>
+ type T <: Node
+ def prepend = new Node { type T = outer.type }
+}
+
+class Main[NextType <: Node](value: Node { type T = NextType })
+ extends Top[Node { type T = NextType }] {
+
+ new Main[AType]( (value: AType).prepend )
+}
+
+/* this used to be a neg test, even though it should've compiled
+SI-8177 fixed this.
+
+Behold the equivalent program which type checks without the fix for SI-8177.
+(Expand type alias, convert type member to type param;
+note the covariance to encode subtyping on type members.)
+
+class Node[+T <: Node[_]] { def prepend = new Node[this.type] }
+class Main[NextType <: Node[_]](value: Node[NextType]) {
+ new Main(value.prepend)
+}
+*/ \ No newline at end of file