aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/templateParents.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-01 18:27:02 +0100
committerMartin Odersky <odersky@gmail.com>2014-03-01 18:27:02 +0100
commitb9e576ad1ba0ff02c550c821648f23905477e545 (patch)
tree5d8116af63cb38a52861941058a1eea62057e8d4 /tests/pos/templateParents.scala
parent340ca0615bc40ca0232143b1d7e206c56e721c5c (diff)
downloaddotty-b9e576ad1ba0ff02c550c821648f23905477e545.tar.gz
dotty-b9e576ad1ba0ff02c550c821648f23905477e545.tar.bz2
dotty-b9e576ad1ba0ff02c550c821648f23905477e545.zip
Check that inferred parent classes are feasible.
Diffstat (limited to 'tests/pos/templateParents.scala')
-rw-r--r--tests/pos/templateParents.scala19
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/pos/templateParents.scala b/tests/pos/templateParents.scala
index 530f8c148..845913270 100644
--- a/tests/pos/templateParents.scala
+++ b/tests/pos/templateParents.scala
@@ -1,12 +1,21 @@
object templateParents {
-// traits do not call a constructor
- class C[+T](x: T)
+ // traits do not call a constructor
+ class C[+T](x: T)
trait D extends C[String]
trait E extends C[Int]
new C("abc") with D
+
+}
- //val x = new D with E
+object templateParents1 {
+ // tests inference of synthesized class type
+ class C[+T]
+ trait D extends C[String]
+ trait E extends C[Int]
+
+ val x = new D with E
+
+ val y: C[Int & String] = x
+}
- //val y: C = x
-} \ No newline at end of file