summaryrefslogtreecommitdiff
path: root/test/pending/pos/those-kinds-are-high.scala
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2011-07-22 16:34:35 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2011-07-22 16:34:35 +0000
commit3307c3771777cf17d5b4d059726a1b484923d042 (patch)
tree90dd3a955d06bd439f69c34a464939a5470897c2 /test/pending/pos/those-kinds-are-high.scala
parentf346e54d24847e0529ce1e5ee43e47a038a4961e (diff)
downloadscala-3307c3771777cf17d5b4d059726a1b484923d042.tar.gz
scala-3307c3771777cf17d5b4d059726a1b484923d042.tar.bz2
scala-3307c3771777cf17d5b4d059726a1b484923d042.zip
Backport from trunk of a large batch of revisions:
24909,24919,24941,24961,24963,24965,24981,24984,24986,24987,24999, 25000,25001,25002,25003,25004,25005,25006,25007,25008,25009,25010, 25015,25028,25029,25030,25031,25033,25037,25038,25039,25040,25041, 25044,25045,25046,25050,25052,25053,25054,25055,25057,25058,25059, 25061,25062,25063,25065,25066,25069,25070,25071,25072,25074,25075, 25076,25080,25081,25082,25083,25085,25087,25088,25090,25091,25092, 25093,25094,25095,25096,25097,25098,25099,25100,25101,25110,25111, 25112,25113,25114,25117,25119,25122,25124,25125,25126,25127,25128, 25130,25132,25133,25134,25135,25136,25137,25138,25138,25139,25140, 25141,25142,25144,25145,25146,25148,25149,25152,25153,25158,25160, 25161,25162,25164,25167,25169,25170,25171,25172,25202,25204,25208, 25209,25252
Diffstat (limited to 'test/pending/pos/those-kinds-are-high.scala')
-rw-r--r--test/pending/pos/those-kinds-are-high.scala37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/pending/pos/those-kinds-are-high.scala b/test/pending/pos/those-kinds-are-high.scala
new file mode 100644
index 0000000000..d3ee2bf308
--- /dev/null
+++ b/test/pending/pos/those-kinds-are-high.scala
@@ -0,0 +1,37 @@
+class A {
+ trait Container[+T]
+ trait Template[+CC[X] <: Container[X]]
+
+ class C1[T] extends Template[C1] with Container[T]
+ class C2[T] extends Template[C2] with Container[T]
+
+ /** Target expression:
+ * List(new C1[String], new C2[String])
+ */
+
+ // Here's what would ideally be inferred.
+ //
+ // scala> :type List[Template[Container] with Container[String]](new C1[String], new C2[String])
+ // List[Template[Container] with Container[java.lang.String]]
+ //
+ // Here's what it does infer.
+ //
+ // scala> :type List(new C1[String], new C2[String])
+ // <console>:8: error: type mismatch;
+ // found : C1[String]
+ // required: Container[String] with Template[Container[Any] with Template[Container[Any] with Template[Any] with ScalaObject] with ScalaObject] with ScalaObject
+ // List(new C1[String], new C2[String])
+ // ^
+ //
+ // Simplified, the inferred type is:
+ //
+ // List[Container[String] with Template[Container[Any] with Template[Container[Any] with Template[Any]]]
+ //
+
+ /** Working version explicitly typed.
+ */
+ def fExplicit = List[Template[Container] with Container[String]](new C1[String], new C2[String])
+
+ // nope
+ // def fFail = List(new C1[String], new C2[String])
+}