aboutsummaryrefslogblamecommitdiff
path: root/tests/pos/templateParents.scala
blob: 1bc07b57174b2353e8755aab25b9b32d1d05b1a5 (plain) (tree)
1
2
3
4
5
6
7
8
9

                        
                                     
                   


                           
 
 
 









                                              
 
object templateParents {

  // 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

}

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
}