summaryrefslogtreecommitdiff
path: root/test/files/neg/variances.check
blob: cb1a60a6323c64c146f2a6c1aa5ab4bb9b6d86e9 (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
25
variances.scala:4: error: covariant type A occurs in contravariant position in type test.Vector[A] of value x
  def append(x: Vector[A]): Vector[A]
             ^
variances.scala:75: error: covariant type A occurs in contravariant position in type => A => A of value m
      val m: A => A
          ^
variances.scala:18: error: covariant type A occurs in contravariant position in type A of value a
    private def setA3(a : A) = this.a = a
                      ^
variances.scala:19: error: covariant type A occurs in contravariant position in type A of value a
    protected def setA4(a : A) = this.a = a
                        ^
variances.scala:21: error: covariant type A occurs in invariant position in supertype test.C[A] of object Baz
    object Baz extends C[A]
           ^
variances.scala:74: error: covariant type A occurs in contravariant position in type => test.Covariant.T[A]{val m: A => A} of value x
    val x: T[A] {
        ^
variances.scala:89: error: covariant type T occurs in invariant position in type T of type A
    type A = T
         ^
variances.scala:90: error: covariant type T occurs in contravariant position in type => test.TestAlias.B[C.this.A] of method foo
    def foo: B[A]
        ^
8 errors found