File tree 2 files changed +16
-1
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +16
-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.normalized)
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
1
+ import deriving .Mirror
2
+ import compiletime .summonInline
3
+
4
+ type DoesNotReduce [T ] = T match
5
+ case String => Any
6
+
7
+ type DoesNotReduce2 [T ] <: T = T match
8
+ case String => T
9
+
10
+ class Foo
11
+ @ main def Test : Unit =
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