Skip to content

Commit f7e2e7c

Browse files
Normalize only when needed
1 parent d3174a1 commit f7e2e7c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Synthesizer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
339339
* or a TermRef to a singleton value. These are
340340
* the base elements required to generate a mirror.
341341
*/
342-
def reduce(mirroredType: Type)(using Context): Either[String, MirrorSource] = mirroredType.normalized match
342+
def reduce(mirroredType: Type)(using Context): Either[String, MirrorSource] = mirroredType match
343343
case tp: TypeRef =>
344344
val sym = tp.symbol
345345
if sym.isClass then // direct ref to a class, not an alias
@@ -379,6 +379,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
379379
// avoid type aliases for tuples
380380
Right(MirrorSource.GenericTuple(types))
381381
case _ => reduce(tp.underlying)
382+
case tp: MatchType => reduce(tp.normalized)
382383
case _ => reduce(tp.superType)
383384
case tp @ AndType(l, r) =>
384385
for

0 commit comments

Comments
 (0)