summaryrefslogtreecommitdiff
path: root/test/files/pos/ticket2251.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2009-08-13 08:37:29 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2009-08-13 08:37:29 +0000
commitabc5b5f47f4bb963e229cb90a6ff93152ee09a98 (patch)
tree91ce7d7d7da87a069b62ab2647cea99b568c55e6 /test/files/pos/ticket2251.scala
parent2416d5724eb7fba3ed5b80092194a27e333a23f3 (diff)
downloadscala-abc5b5f47f4bb963e229cb90a6ff93152ee09a98.tar.gz
scala-abc5b5f47f4bb963e229cb90a6ff93152ee09a98.tar.bz2
scala-abc5b5f47f4bb963e229cb90a6ff93152ee09a98.zip
fixed #2251
Diffstat (limited to 'test/files/pos/ticket2251.scala')
-rw-r--r--test/files/pos/ticket2251.scala23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/files/pos/ticket2251.scala b/test/files/pos/ticket2251.scala
new file mode 100644
index 0000000000..1e8727e999
--- /dev/null
+++ b/test/files/pos/ticket2251.scala
@@ -0,0 +1,23 @@
+// derived from pos/bug1001
+class A
+trait B[T <: B[T]] extends A
+class C extends B[C]
+class D extends B[D]
+
+class Data {
+ // force computing lub of C and D (printLubs enabled:)
+
+/*
+lub of List(D, C) at depth 2
+ lub of List(D, C) at depth 1
+ lub of List(D, C) at depth 0
+ lub of List(D, C) is A
+ lub of List(D, C) is B[_1] forSome { type _1 >: D with C <: A }
+lub of List(D, C) is B[_2] forSome { type _2 >: D with C{} <: B[_1] forSome { type _1 >: D with C{} <: A } }
+*/
+// --> result = WRONG
+
+ // should be: B[X] forSome {type X <: B[X]} -- can this be done automatically? for now, just detect f-bounded polymorphism and fall back to more coarse approximation
+
+ val data: List[A] = List(new C, new D)
+}