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