diff options
author | Martin Odersky <odersky@gmail.com> | 2015-10-06 13:47:43 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-10-06 13:52:03 +0200 |
commit | 0a48b2a6d3516f1f7d10d9a2a594a744ef98d5e8 (patch) | |
tree | d638064464337fab7d930c2427664895d00b59f7 /src | |
parent | 0838b81bea4d579f812c02fafdc50e2b1920c059 (diff) | |
download | dotty-0a48b2a6d3516f1f7d10d9a2a594a744ef98d5e8.tar.gz dotty-0a48b2a6d3516f1f7d10d9a2a594a744ef98d5e8.tar.bz2 dotty-0a48b2a6d3516f1f7d10d9a2a594a744ef98d5e8.zip |
Make prefix covariant in type maps.
According to the new subtyping rules,
T <: U ==> T#X <: U#X and T#x <: U#x
Therefore type maps should treat the prefix of a named type
covariantly.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index e4f228915..1d438daf0 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2884,13 +2884,7 @@ object Types { tp match { case tp: NamedType => if (stopAtStatic && tp.symbol.isStatic) tp - else { - val saved = variance - variance = 0 - val result = tp.derivedSelect(this(tp.prefix)) - variance = saved - result - } + else tp.derivedSelect(this(tp.prefix)) case _: ThisType | _: BoundType |