@@ -468,11 +468,6 @@ object Types extends TypeUtils {
468
468
/** Does this application expand to a match type? */
469
469
def isMatchAlias (using Context ): Boolean = underlyingMatchType.exists
470
470
471
- def underlyingMatchType (using Context ): Type = this .safeDealias.stripLazyRef match
472
- case tp : MatchType => tp
473
- case tp : AppliedType => tp.underlyingMatchType
474
- case _ => NoType
475
-
476
471
/** Is this a higher-kinded type lambda with given parameter variances?
477
472
* These lambdas are used as the RHS of higher-kinded abstract types or
478
473
* type aliases. The variance info is strictly needed only for abstract types.
@@ -1538,9 +1533,14 @@ object Types extends TypeUtils {
1538
1533
* of S[n] types, the result after applying all toplevel normalizations,
1539
1534
* otherwise NoType
1540
1535
*/
1541
- def tryNormalize (using Context ): Type =
1542
- if isMatchAlias then underlyingMatchType.tryNormalize
1543
- else NoType
1536
+ def tryNormalize (using Context ): Type = underlyingMatchType match
1537
+ case mt : MatchType => mt.reduced.normalized
1538
+ case _ => NoType
1539
+
1540
+ def underlyingMatchType (using Context ): Type = this .safeDealias.stripLazyRef match
1541
+ case tp : MatchType => tp
1542
+ case tp : AppliedType => tp.underlyingMatchType
1543
+ case _ => NoType
1544
1544
1545
1545
private def widenDealias1 (keep : AnnotatedType => Context ?=> Boolean )(using Context ): Type = {
1546
1546
val res = this .widen.dealias1(keep, keepOpaques = false )
@@ -5085,13 +5085,6 @@ object Types extends TypeUtils {
5085
5085
private var myReduced : Type | Null = null
5086
5086
private var reductionContext : util.MutableMap [Type , Type ] | Null = null
5087
5087
5088
- override def tryNormalize (using Context ): Type =
5089
- try
5090
- reduced.normalized
5091
- catch
5092
- case ex : Throwable =>
5093
- handleRecursive(" normalizing" , s " ${scrutinee.show} match ... " , ex)
5094
-
5095
5088
private def thisMatchType = this
5096
5089
5097
5090
def reduced (using Context ): Type = atPhaseNoLater(elimOpaquePhase) {
0 commit comments