@@ -1556,11 +1556,13 @@ object Types extends TypeUtils {
1556
1556
if (normed.exists) normed else this
1557
1557
}
1558
1558
1559
- /** If this type can be normalized at the top-level by rewriting match types
1560
- * of S[n] types, the result after applying all toplevel normalizations,
1561
- * otherwise NoType
1559
+ /** If this type has an underlying match type or applied compiletime.ops,
1560
+ * then the result after applying all toplevel normalizations, otherwise NoType.
1562
1561
*/
1563
- def tryNormalize (using Context ): Type = NoType
1562
+ def tryNormalize (using Context ): Type = underlyingNormalizable match
1563
+ case mt : MatchType => mt.tryNormalize
1564
+ case tp : AppliedType => tp.tryCompiletimeConstantFold
1565
+ case _ => NoType
1564
1566
1565
1567
private def widenDealias1 (keep : AnnotatedType => Context ?=> Boolean )(using Context ): Type = {
1566
1568
val res = this .widen.dealias1(keep, keepOpaques = false )
@@ -4693,14 +4695,9 @@ object Types extends TypeUtils {
4693
4695
cachedUnderlyingNormalizable
4694
4696
4695
4697
override def tryNormalize (using Context ): Type =
4696
- def tryMatchAlias =
4697
- if isMatchAlias then trace(i " normalize $this" , typr, show = true ):
4698
- if MatchTypeTrace .isRecording then
4699
- MatchTypeTrace .recurseWith(this )(superType.tryNormalize)
4700
- else
4701
- underlyingNormalizable.tryNormalize
4702
- else NoType
4703
- tryCompiletimeConstantFold.orElse(tryMatchAlias)
4698
+ if isMatchAlias && MatchTypeTrace .isRecording then
4699
+ MatchTypeTrace .recurseWith(this )(superType.tryNormalize)
4700
+ else super .tryNormalize
4704
4701
4705
4702
/** Is this an unreducible application to wildcard arguments?
4706
4703
* This is the case if tycon is higher-kinded. This means
0 commit comments