Skip to content

Commit

Permalink
Normalize only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneFlesselle committed Dec 5, 2023
1 parent d3174a1 commit f7e2e7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Synthesizer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
* or a TermRef to a singleton value. These are
* the base elements required to generate a mirror.
*/
def reduce(mirroredType: Type)(using Context): Either[String, MirrorSource] = mirroredType.normalized match
def reduce(mirroredType: Type)(using Context): Either[String, MirrorSource] = mirroredType match
case tp: TypeRef =>
val sym = tp.symbol
if sym.isClass then // direct ref to a class, not an alias
Expand Down Expand Up @@ -379,6 +379,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
// avoid type aliases for tuples
Right(MirrorSource.GenericTuple(types))
case _ => reduce(tp.underlying)
case tp: MatchType => reduce(tp.normalized)
case _ => reduce(tp.superType)
case tp @ AndType(l, r) =>
for
Expand Down

0 comments on commit f7e2e7c

Please sign in to comment.