diff options
author | Martin Odersky <odersky@gmail.com> | 2014-10-11 22:05:25 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-10-12 10:51:49 +0200 |
commit | 4e897165d9dbd58536a176b9901e0c62457e6b4d (patch) | |
tree | cdf3d8ae45d08862fb8b212272065e43f3d2aadd | |
parent | 73e7da5ecae2aa77f0adf23a430092e039cb2c9a (diff) | |
download | dotty-4e897165d9dbd58536a176b9901e0c62457e6b4d.tar.gz dotty-4e897165d9dbd58536a176b9901e0c62457e6b4d.tar.bz2 dotty-4e897165d9dbd58536a176b9901e0c62457e6b4d.zip |
Fix bug in varianceInType
-rw-r--r-- | src/dotty/tools/dotc/typer/Variances.scala | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Variances.scala b/src/dotty/tools/dotc/typer/Variances.scala index 44b64553b..0fec1e5a7 100644 --- a/src/dotty/tools/dotc/typer/Variances.scala +++ b/src/dotty/tools/dotc/typer/Variances.scala @@ -68,11 +68,10 @@ object Variances { /** Compute variance of type parameter <code>tparam</code> in type <code>tp</code>. */ def varianceInType(tp: Type)(tparam: Symbol)(implicit ctx: Context): Variance = tp match { - case TermRef(pre, sym) => + case TermRef(pre, _) => varianceInType(pre)(tparam) - case TypeRef(pre, sym) => - /* @odersky sym is a typeName here, comparison is always false */ - if (sym == tparam) Covariant else varianceInType(pre)(tparam) + case tp @ TypeRef(pre, _) => + if (tp.symbol == tparam) Covariant else varianceInType(pre)(tparam) case tp @ TypeBounds(lo, hi) => if (lo eq hi) compose(varianceInType(hi)(tparam), tp.variance) else flip(varianceInType(lo)(tparam)) & varianceInType(hi)(tparam) |