@@ -1488,11 +1488,13 @@ object Types extends TypeUtils {
1488
1488
if (normed.exists) normed else this
1489
1489
}
1490
1490
1491
- /** If this type can be normalized at the top-level by rewriting match types
1492
- * of S[n] types, the result after applying all toplevel normalizations,
1493
- * otherwise NoType
1491
+ /** If this type has an underlying match type or applied compiletime.ops,
1492
+ * then the result after applying all toplevel normalizations, otherwise NoType.
1494
1493
*/
1495
- def tryNormalize (using Context ): Type = NoType
1494
+ def tryNormalize (using Context ): Type = underlyingNormalizable match
1495
+ case mt : MatchType => mt.tryNormalize
1496
+ case tp : AppliedType => tp.tryCompiletimeConstantFold
1497
+ case _ => NoType
1496
1498
1497
1499
private def widenDealias1 (keep : AnnotatedType => Context ?=> Boolean )(using Context ): Type = {
1498
1500
val res = this .widen.dealias1(keep, keepOpaques = false )
@@ -4532,14 +4534,9 @@ object Types extends TypeUtils {
4532
4534
cachedUnderlyingNormalizable
4533
4535
4534
4536
override def tryNormalize (using Context ): Type =
4535
- def tryMatchAlias =
4536
- if isMatchAlias then trace(i " normalize $this" , typr, show = true ):
4537
- if MatchTypeTrace .isRecording then
4538
- MatchTypeTrace .recurseWith(this )(superType.tryNormalize)
4539
- else
4540
- underlyingNormalizable.tryNormalize
4541
- else NoType
4542
- tryCompiletimeConstantFold.orElse(tryMatchAlias)
4537
+ if isMatchAlias && MatchTypeTrace .isRecording then
4538
+ MatchTypeTrace .recurseWith(this )(superType.tryNormalize)
4539
+ else super .tryNormalize
4543
4540
4544
4541
/** Is this an unreducible application to wildcard arguments?
4545
4542
* This is the case if tycon is higher-kinded. This means
0 commit comments