File tree 2 files changed +14
-1
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
338
338
* or a TermRef to a singleton value. These are
339
339
* the base elements required to generate a mirror.
340
340
*/
341
- def reduce (mirroredType : Type )(using Context ): Either [String , MirrorSource ] = mirroredType match
341
+ def reduce (mirroredType : Type )(using Context ): Either [String , MirrorSource ] = mirroredType.normalized match
342
342
case tp : TypeRef =>
343
343
val sym = tp.symbol
344
344
if sym.isClass then // direct ref to a class, not an alias
Original file line number Diff line number Diff line change
1
+ import deriving .Mirror
2
+ import compiletime .summonInline
3
+
4
+ inline def check1 [Tps <: NonEmptyTuple ]: Unit =
5
+ summonInline[Mirror .Of [Tuple .Head [Tps ]]]
6
+
7
+ inline def check2 [Tps <: NonEmptyTuple ]: Unit =
8
+ type FromType = Tuple .Head [Tps ]
9
+ summonInline[Mirror .Of [FromType ]]
10
+
11
+ @ main def Test : Unit =
12
+ check1[Option [Int ] *: EmptyTuple ] // Ok
13
+ check2[Option [Int ] *: EmptyTuple ] // Error: FromType is widened to Any in Syntheziser
You can’t perform that action at this time.
0 commit comments