Skip to content

Commit 4f488c8

Browse files
EugeneFlesselleWojciechMazur
authored andcommitted
Normalize only when needed
[Cherry-picked f7e2e7c]
1 parent 1787e74 commit 4f488c8

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
@@ -338,7 +338,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
338338
* or a TermRef to a singleton value. These are
339339
* the base elements required to generate a mirror.
340340
*/
341-
def reduce(mirroredType: Type)(using Context): Either[String, MirrorSource] = mirroredType.normalized match
341+
def reduce(mirroredType: Type)(using Context): Either[String, MirrorSource] = mirroredType match
342342
case tp: TypeRef =>
343343
val sym = tp.symbol
344344
if sym.isClass then // direct ref to a class, not an alias
@@ -378,6 +378,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
378378
// avoid type aliases for tuples
379379
Right(MirrorSource.GenericTuple(types))
380380
case _ => reduce(tp.underlying)
381+
case tp: MatchType => reduce(tp.normalized)
381382
case _ => reduce(tp.superType)
382383
case tp @ AndType(l, r) =>
383384
for

0 commit comments

Comments
 (0)