blob: 316d8c81c175de1534ec600736758b75d4d0388c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
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
}
new C("abc") with D
}
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
}
|