aboutsummaryrefslogtreecommitdiff
path: root/tests/pickling/templateParents.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pickling/templateParents.scala')
-rw-r--r--tests/pickling/templateParents.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/pickling/templateParents.scala b/tests/pickling/templateParents.scala
new file mode 100644
index 000000000..153c4b4da
--- /dev/null
+++ b/tests/pickling/templateParents.scala
@@ -0,0 +1,25 @@
+object templateParents {
+
+ // traits do not call a constructor
+ class C[+T](val x: T)
+ trait D extends C[String]
+ trait E extends C[Int]
+ class F extends C[Boolean](true) {
+ def foo = x
+ }
+ val cd = new C("abc") with D
+ cd.x
+
+}
+
+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
+}
+