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 @@ -379,7 +379,9 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
379
379
// avoid type aliases for tuples
380
380
Right (MirrorSource .GenericTuple (types))
381
381
case _ => reduce(tp.underlying)
382
- case tp : MatchType => reduce(tp.tryNormalize.orElse(tp.superType))
382
+ case tp : MatchType =>
383
+ val n = tp.tryNormalize
384
+ if n.exists then reduce(n) else Left (i " its subpart ` $tp` is an unreducible match type. " )
383
385
case _ => reduce(tp.superType)
384
386
case tp @ AndType (l, r) =>
385
387
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