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 {
411411
412412 /* Erase a type binding according to erasure semantics in pattern matching */
413413 def erase (tp : Type ): Type = tp match {
414- case tp@ AppliedType (tycon, args) => erase(tp.superType)
414+ case tp @ AppliedType (tycon, args) =>
415415 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 ))
417417 case OrType (tp1, tp2) =>
418418 OrType (erase(tp1), erase(tp2))
419419 case AndType (tp1, tp2) =>
@@ -583,7 +583,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
583583 val typeParamMap = new TypeMap {
584584 def apply (t : Type ): Type = t match {
585585
586- case tp : TypeRef if tp.underlying.isInstanceOf [TypeBounds ] =>
586+ case tp : TypeRef if tp.symbol.is( TypeParam ) && tp. underlying.isInstanceOf [TypeBounds ] =>
587587 // See tests/patmat/gadt.scala tests/patmat/exhausting.scala
588588 val bound =
589589 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