diff options
author | Paul Phillips <paulp@improving.org> | 2012-04-02 08:23:57 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-04-02 09:23:25 -0700 |
commit | 03f32bd22f85bf3a6f8824dbe4a7a989e717c071 (patch) | |
tree | 4befb2ee97185754d9db670494698c035aeea445 /test/files/neg/variances.check | |
parent | f7535f72903f083b2444fb1d0b73363efa5482e9 (diff) | |
download | scala-03f32bd22f85bf3a6f8824dbe4a7a989e717c071.tar.gz scala-03f32bd22f85bf3a6f8824dbe4a7a989e717c071.tar.bz2 scala-03f32bd22f85bf3a6f8824dbe4a7a989e717c071.zip |
Fix for SI-3272.
"References to the type parameters in object-private or
object-protected values, variables, or methods (ยง5.2) of
the class are not checked for their variance position."
Review by @odersky.
Diffstat (limited to 'test/files/neg/variances.check')
-rw-r--r-- | test/files/neg/variances.check | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/test/files/neg/variances.check b/test/files/neg/variances.check index dc72b05e1e..0643e533b7 100644 --- a/test/files/neg/variances.check +++ b/test/files/neg/variances.check @@ -1,16 +1,19 @@ 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] + def append(x: Vector[A]): Vector[A] ^ -variances.scala:14: error: covariant type A occurs in contravariant position in type A of value a - private[this] def setA(a : A) = this.a = a - ^ -variances.scala:16: error: covariant type A occurs in invariant position in supertype test.C[A] of object Baz +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:63: error: covariant type A occurs in contravariant position in type => test.Covariant.T[A]{val m: A => A} of value x +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:79: error: covariant type T occurs in contravariant position in type => test.TestAlias.B[C.this.A] of method foo +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] ^ -5 errors found +6 errors found |