File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 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):
378378 // avoid type aliases for tuples
379379 Right (MirrorSource .GenericTuple (types))
380380 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. " )
382384 case _ => reduce(tp.superType)
383385 case tp @ AndType (l, r) =>
384386 for
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ import compiletime.summonInline
44type DoesNotReduce [T ] = T match
55 case String => Any
66
7+ type DoesNotReduce2 [T ] <: T = T match
8+ case String => T
9+
710class Foo
811@ main def Test : Unit =
912 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