File tree 2 files changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,9 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
378
378
// avoid type aliases for tuples
379
379
Right (MirrorSource .GenericTuple (types))
380
380
case _ => reduce(tp.underlying)
381
- case tp : MatchType => reduce(tp.tryNormalize.orElse(tp.superType))
381
+ case tp : MatchType =>
382
+ val n = tp.tryNormalize
383
+ if n.exists then reduce(n) else Left (i " its subpart ` $tp` is an unreducible match type. " )
382
384
case _ => reduce(tp.superType)
383
385
case tp @ AndType (l, r) =>
384
386
for
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ import compiletime.summonInline
4
4
type DoesNotReduce [T ] = T match
5
5
case String => Any
6
6
7
+ type DoesNotReduce2 [T ] <: T = T match
8
+ case String => T
9
+
7
10
class Foo
8
11
@ main def Test : Unit =
9
12
summonInline[Mirror .Of [DoesNotReduce [Option [Int ]]]] // error
13
+ summonInline[Mirror .Of [DoesNotReduce2 [Option [Int ]]]] // error
You can’t perform that action at this time.
0 commit comments