Skip to content

Commit baa845b

Browse files
committed
Harmonize variance of prefix in TypeArgRefs and TypeRefs
1 parent e3fbf30 commit baa845b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3851,7 +3851,7 @@ object Types {
38513851
mapOverLambda
38523852

38533853
case tp @ TypeArgRef(prefix, _, _) =>
3854-
derivedTypeArgRef(tp, atVariance(0)(this(prefix)))
3854+
derivedTypeArgRef(tp, atVariance(variance max 0)(this(prefix)))
38553855

38563856
case tp @ SuperType(thistp, supertp) =>
38573857
derivedSuperType(tp, this(thistp), this(supertp))
@@ -4253,7 +4253,7 @@ object Types {
42534253
this(x, tp.info)
42544254

42554255
case tp @ TypeArgRef(prefix, _, _) =>
4256-
atVariance(0)(this(x, prefix))
4256+
atVariance(variance max 0)(this(x, prefix))
42574257

42584258
case SuperType(thistp, supertp) =>
42594259
this(this(x, thistp), supertp)

0 commit comments

Comments
 (0)