diff options
author | Martin Odersky <odersky@gmail.com> | 2007-05-16 22:34:26 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-05-16 22:34:26 +0000 |
commit | 4c1f8c38102e4ef5905d6166d4ab6db4047d9ada (patch) | |
tree | 50b4acd781cef3fe7d902bbe5cec3bcd8e660119 /src/compiler | |
parent | 00736e1092176105477fc4d40b29a4354d78e8fd (diff) | |
download | scala-4c1f8c38102e4ef5905d6166d4ab6db4047d9ada.tar.gz scala-4c1f8c38102e4ef5905d6166d4ab6db4047d9ada.tar.bz2 scala-4c1f8c38102e4ef5905d6166d4ab6db4047d9ada.zip |
fixed itay's problem with variances
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 2b5d898fa5..ae4fc804e6 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -377,7 +377,9 @@ abstract class RefChecks extends InfoTransform { var state = CoVariance while (sym != clazz && state != AnyVariance) { //Console.println("flip: " + sym + " " + sym.isParameter());//DEBUG - if ((sym hasFlag PARAM) && !sym.owner.isConstructor) state = -state; + if ((sym hasFlag PARAM) && !sym.owner.isConstructor && + !(tvar.isTypeParameterOrSkolem && sym.isTypeParameterOrSkolem && + tvar.owner == sym.owner)) state = -state; else if (!sym.owner.isClass || sym.isPrivateLocal) state = AnyVariance; else if (sym.isAliasType) state = NoVariance; sym = sym.owner |