File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -411,9 +411,9 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
411
411
412
412
/* Erase a type binding according to erasure semantics in pattern matching */
413
413
def erase (tp : Type ): Type = tp match {
414
- case tp@ AppliedType (tycon, args) => erase(tp.superType)
414
+ case tp @ AppliedType (tycon, args) =>
415
415
if (tycon.isRef(defn.ArrayClass )) tp.derivedAppliedType(tycon, args.map(erase))
416
- else tp.derivedAppliedType(tycon, args.map(t => WildcardType ( TypeBounds .empty) ))
416
+ else tp.derivedAppliedType(tycon, args.map(t => WildcardType ))
417
417
case OrType (tp1, tp2) =>
418
418
OrType (erase(tp1), erase(tp2))
419
419
case AndType (tp1, tp2) =>
@@ -583,7 +583,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
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 ] =>
586
+ case tp : TypeRef if tp.symbol.is( TypeParam ) && tp. underlying.isInstanceOf [TypeBounds ] =>
587
587
// See tests/patmat/gadt.scala tests/patmat/exhausting.scala
588
588
val bound =
589
589
if (variance == 0 ) tp.underlying.bounds // non-variant case is not well-founded
You can’t perform that action at this time.
0 commit comments