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 @@ -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.normalized)
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
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