Skip to content

Commit 0a48b2a

Browse files
committed
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.
1 parent 0838b81 commit 0a48b2a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,13 +2884,7 @@ object Types {
28842884
tp match {
28852885
case tp: NamedType =>
28862886
if (stopAtStatic && tp.symbol.isStatic) tp
2887-
else {
2888-
val saved = variance
2889-
variance = 0
2890-
val result = tp.derivedSelect(this(tp.prefix))
2891-
variance = saved
2892-
result
2893-
}
2887+
else tp.derivedSelect(this(tp.prefix))
28942888

28952889
case _: ThisType
28962890
| _: BoundType

0 commit comments

Comments
 (0)