summaryrefslogtreecommitdiff
path: root/test/files/neg/tcpoly_ticket2101.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2009-10-01 14:26:56 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2009-10-01 14:26:56 +0000
commitfe264943efccc2534a65ce0b49ed16a51e597aed (patch)
treea30ac4abd80845b04e13f7a61bcdffec18ead7b1 /test/files/neg/tcpoly_ticket2101.scala
parent082a427ff9572e002bb1fc5c71e129e857f0aa81 (diff)
downloadscala-fe264943efccc2534a65ce0b49ed16a51e597aed.tar.gz
scala-fe264943efccc2534a65ce0b49ed16a51e597aed.tar.bz2
scala-fe264943efccc2534a65ce0b49ed16a51e597aed.zip
fixed #2101
there were some issues with heap pressure that made the compile take incredibly long, these were solved by increasing the max allowed heap
Diffstat (limited to 'test/files/neg/tcpoly_ticket2101.scala')
-rw-r--r--test/files/neg/tcpoly_ticket2101.scala28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/files/neg/tcpoly_ticket2101.scala b/test/files/neg/tcpoly_ticket2101.scala
new file mode 100644
index 0000000000..68f061ce70
--- /dev/null
+++ b/test/files/neg/tcpoly_ticket2101.scala
@@ -0,0 +1,28 @@
+class T[A[Y] <: T[A, B], B]
+class T2[X] extends T[T2, X] // ill-typed
+// because this bound is not met:
+// Forall Y. T2[Y] <: T[T2, X]
+
+// debugging before fix:
+// def isSubType0 -->
+// case (PolyType(tparams1, res1), PolyType(tparams2, res2)) => println("<:<PT: "+((tparams1, res1), (tparams2, res2))) //@MDEBUG
+// (tparams1.length == tparams2.length &&
+// List.forall2(tparams1, tparams2)
+// ((p1, p2) => p2.info.substSym(tparams2, tparams1) <:< p1.info) &&
+// res1 <:< res2.substSym(tparams2, tparams1))
+
+// generates output:
+// <:<PT: ((List(type Y),A[Y]),(List(type Y),T[A,B]))
+// <:<PT: ((List(type X),T2[X]),(List(type Y),T[T2,X]))
+
+// however, last check should have been:
+// <:<PT: ((List(type X1),T2[X1]),(List(type Y1),T[T2,X]))
+
+// case (PolyType(tparams1, res1), PolyType(tparams2, res2)) => println("<:<PT: "+((tparams1, res1), (tparams2, res2))) //@MDEBUG
+// (tparams1.length == tparams2.length &&
+// {
+// val tpsFresh = cloneSymbols(tparams1) // @M cloneSymbols(tparams2) should be equivalent -- TODO: check
+// List.forall2(tparams1, tparams2)
+// ((p1, p2) => p2.info.substSym(tparams2, tpsFresh) <:< p1.info.substSym(tparams1, tpsFresh)) &&
+// res1.substSym(tparams1, tpsFresh) <:< res2.substSym(tparams2, tpsFresh)
+// })