Skip to content

Commit c0097c8

Browse files
Reduce selector while normalizing Match
1 parent b885a2f commit c0097c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,9 @@ private final class NormalizeMap(implicit ctx: Context) extends TypeMap {
263263
}
264264

265265
case tp @ TypeOf.Match(selector, cases) =>
266+
val tp1 = TypeOf.Match.derived(tp)(apply(selector), cases).asInstanceOf[TypeOf]
266267
new PatternMatcher.Translator(NoType, null)(ctx.enterTypeOf())
267-
.evaluateMatch(tp.tree.asInstanceOf[Match], normalizeBoolType).getOrElse(Stuck(tp))
268+
.evaluateMatch(tp1.tree.asInstanceOf[Match], normalizeBoolType).getOrElse(Stuck(tp1))
268269

269270
case tp =>
270271
mapOver(tp) match {

0 commit comments

Comments
 (0)