Skip to content

Commit e3c0aaf

Browse files
committed
Harmonize variance of prefix in TypeArgRefs and TypeRefs
1 parent 2524788 commit e3c0aaf

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
@@ -3845,7 +3845,7 @@ object Types {
38453845
mapOverLambda
38463846

38473847
case tp @ TypeArgRef(prefix, _, _) =>
3848-
derivedTypeArgRef(tp, atVariance(0)(this(prefix)))
3848+
derivedTypeArgRef(tp, atVariance(variance max 0)(this(prefix)))
38493849

38503850
case tp @ SuperType(thistp, supertp) =>
38513851
derivedSuperType(tp, this(thistp), this(supertp))
@@ -4247,7 +4247,7 @@ object Types {
42474247
this(x, tp.info)
42484248

42494249
case tp @ TypeArgRef(prefix, _, _) =>
4250-
atVariance(0)(this(x, prefix))
4250+
atVariance(variance max 0)(this(x, prefix))
42514251

42524252
case SuperType(thistp, supertp) =>
42534253
this(this(x, thistp), supertp)

0 commit comments

Comments
 (0)