@@ -1532,11 +1532,13 @@ object Types extends TypeUtils {
1532
1532
if (normed.exists) normed else this
1533
1533
}
1534
1534
1535
- /** If this type can be normalized at the top-level by rewriting match types
1536
- * of S[n] types, the result after applying all toplevel normalizations,
1537
- * otherwise NoType
1535
+ /** If this type has an underlying match type or applied compiletime.ops,
1536
+ * then the result after applying all toplevel normalizations, otherwise NoType.
1538
1537
*/
1539
- def tryNormalize (using Context ): Type = NoType
1538
+ def tryNormalize (using Context ): Type = underlyingNormalizable match
1539
+ case mt : MatchType => mt.tryNormalize
1540
+ case tp : AppliedType => tp.tryCompiletimeConstantFold
1541
+ case _ => NoType
1540
1542
1541
1543
private def widenDealias1 (keep : AnnotatedType => Context ?=> Boolean )(using Context ): Type = {
1542
1544
val res = this .widen.dealias1(keep, keepOpaques = false )
@@ -4656,14 +4658,9 @@ object Types extends TypeUtils {
4656
4658
cachedUnderlyingNormalizable
4657
4659
4658
4660
override def tryNormalize (using Context ): Type =
4659
- def tryMatchAlias =
4660
- if isMatchAlias then trace(i " normalize $this" , typr, show = true ):
4661
- if MatchTypeTrace .isRecording then
4662
- MatchTypeTrace .recurseWith(this )(superType.tryNormalize)
4663
- else
4664
- underlyingNormalizable.tryNormalize
4665
- else NoType
4666
- tryCompiletimeConstantFold.orElse(tryMatchAlias)
4661
+ if isMatchAlias && MatchTypeTrace .isRecording then
4662
+ MatchTypeTrace .recurseWith(this )(superType.tryNormalize)
4663
+ else super .tryNormalize
4667
4664
4668
4665
/** Is this an unreducible application to wildcard arguments?
4669
4666
* This is the case if tycon is higher-kinded. This means
0 commit comments