File tree 1 file changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/transform/patmat
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -582,15 +582,17 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
582
582
// replace type parameter references with fresh type vars or bounds
583
583
val typeParamMap = new TypeMap {
584
584
def apply (t : Type ): Type = t match {
585
+
585
586
case tp : TypeRef if tp.underlying.isInstanceOf [TypeBounds ] =>
587
+ // See tests/patmat/gadt.scala tests/patmat/exhausting.scala
586
588
val bound =
587
- if (variance == 0 ) tp.underlying.bounds
589
+ if (variance == 0 ) tp.underlying.bounds // non-variant case is not well-founded
588
590
else if (variance == 1 ) TypeBounds .upper(tp)
589
591
else TypeBounds .lower(tp)
590
592
newTypeVar(bound)
591
593
case tp : RefinedType if tp.refinedInfo.isInstanceOf [TypeBounds ] =>
592
- // Ideally, we would expect type inference can do the job
593
- // tests/patmat/t9657.scala
594
+ // Ideally, we would expect type inference to do the job
595
+ // Check tests/patmat/t9657.scala
594
596
expose(tp)
595
597
case _ =>
596
598
mapOver(t)
You can’t perform that action at this time.
0 commit comments