File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3594,8 +3594,14 @@ class MatchReducer(initctx: Context) extends TypeComparer(initctx) {
3594
3594
MatchTypeTrace .emptyScrutinee(scrut)
3595
3595
NoType
3596
3596
case Nil =>
3597
- val casesText = MatchTypeTrace .noMatchesText(scrut, cases)
3598
- throw MatchTypeReductionError (em " Match type reduction $casesText" )
3597
+ if ctx.isTyper then
3598
+ val casesText = MatchTypeTrace .noMatchesText(scrut, cases)
3599
+ throw MatchTypeReductionError (em " Match type reduction $casesText" )
3600
+ else
3601
+ NoType
3602
+ /* The match type is left unreduced if an error can not be reported
3603
+ * See pos/constvalue-of-failed-match-type.scala for an example
3604
+ */
3599
3605
3600
3606
inFrozenConstraint(recur(cases))
3601
3607
}
You can’t perform that action at this time.
0 commit comments