summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-08-16 14:50:25 -0700
committerPaul Phillips <paulp@improving.org>2012-08-16 14:50:25 -0700
commit847966d65d42cd82be110856d2f354e365edbf15 (patch)
tree9bd584d518f5a2234b67840fc16fd98cfca3b781 /test/files/pos
parent4a71d4abc8c0613d247a5d765d735d3c3c13e694 (diff)
parentdb46c71e8830639bc79e6363332a06642fd3d8cc (diff)
downloadscala-847966d65d42cd82be110856d2f354e365edbf15.tar.gz
scala-847966d65d42cd82be110856d2f354e365edbf15.tar.bz2
scala-847966d65d42cd82be110856d2f354e365edbf15.zip
Merge pull request #1122 from paulp/topic/lubbing-not-flubbing
Improvement for SI-2251, failure to lub f-bounds.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/ticket2251.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/pos/ticket2251.scala b/test/files/pos/ticket2251.scala
index b3afee4ea9..c220e85350 100644
--- a/test/files/pos/ticket2251.scala
+++ b/test/files/pos/ticket2251.scala
@@ -22,4 +22,18 @@ lub of List(D, C) is B[_2] forSome { type _2 >: D with C{} <: B[_1] forSome { ty
// 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)
+
+ val data2 = List(new C, new D)
+
+ val data3: List[B[X] forSome { type X <: B[_ <: A] }] = List(new C, new D)
+
+ // Not yet --
+ // val data4: List[B[X] forSome { type X <: B[X] }] = List(new C, new D)
+ // <console>:7: error: type mismatch;
+ // found : List[B[_ >: D with C <: B[_ >: D with C <: A]]]
+ // required: List[B[X] forSome { type X <: B[X] }]
+ // val data4: List[B[X] forSome { type X <: B[X] }] = List(new C, new D)
+
+ // works
+ val data5 = List[B[X] forSome { type X <: B[X] }](new C, new D)
}