aboutsummaryrefslogblamecommitdiff
path: root/tests/invalid/pos/t4553.scala
blob: 48846a369c03a5220af77e4a9adbc508abcc3a71 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
                                                                    
                                          
                                                   








                                                                              
// Invalid because hk type parameters may not appear in lower bounds
trait VectorLike[+T, +V[A] <: Vector[A]] {
  def +[S, VResult[S] >: V[S]](v: VResult[S]): Unit
}

trait Vector[+T] extends VectorLike[T, Vector]
trait ImmutableVector[T] extends Vector[T] with VectorLike[T, ImmutableVector]
trait MutableVector[T] extends Vector[T] with VectorLike[T, MutableVector]

object Test {
  def f = (null: MutableVector[Int]) + (null: ImmutableVector[Int])
}