Skip to content

Commit 11cb7af

Browse files
tryCompiletimeConstantFold in simplify
1 parent f3ea3ce commit 11cb7af

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,8 @@ object TypeOps:
142142
case defn.MatchCase(pat, body) =>
143143
defn.MatchCase(simplify(pat, theMap), body)
144144
case tp: AppliedType =>
145-
tp.tycon match
146-
case tycon: TypeRef if tp.isMatchAlias =>
147-
isFullyDefined(tp, ForceDegree.all)
148-
case _ =>
149-
val normed = tp.tryNormalize
145+
if tp.isMatchAlias then isFullyDefined(tp, ForceDegree.all)
146+
val normed = tp.tryNormalize.orElse(tp.tryCompiletimeConstantFold)
150147
if normed.exists then simplify(normed, theMap) else tp.map(simplify(_, theMap))
151148
case tp: TypeParamRef =>
152149
val tvar = ctx.typerState.constraint.typeVarOfParam(tp)

0 commit comments

Comments
 (0)