Skip to content

Commit c0642c4

Browse files
committed
Harmonize variance of prefix in TypeArgRefs and TypeRefs
1 parent 7e919b6 commit c0642c4

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
@@ -3864,7 +3864,7 @@ object Types {
38643864
mapOverLambda
38653865

38663866
case tp @ TypeArgRef(prefix, _, _) =>
3867-
derivedTypeArgRef(tp, atVariance(0)(this(prefix)))
3867+
derivedTypeArgRef(tp, atVariance(variance max 0)(this(prefix)))
38683868

38693869
case tp @ SuperType(thistp, supertp) =>
38703870
derivedSuperType(tp, this(thistp), this(supertp))
@@ -4266,7 +4266,7 @@ object Types {
42664266
this(x, tp.info)
42674267

42684268
case tp @ TypeArgRef(prefix, _, _) =>
4269-
atVariance(0)(this(x, prefix))
4269+
atVariance(variance max 0)(this(x, prefix))
42704270

42714271
case SuperType(thistp, supertp) =>
42724272
this(this(x, thistp), supertp)

0 commit comments

Comments
 (0)