File tree 2 files changed +8
-2
lines changed
compiler/src/dotty/tools/dotc 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2771,7 +2771,7 @@ object Parsers {
2771
2771
atSpan(startOffset(pat), accept(LARROW )) {
2772
2772
val checkMode =
2773
2773
if casePat then GenCheckMode .FilterAlways
2774
- else if sourceVersion.isAtLeast(`future `) then GenCheckMode .Check
2774
+ else if sourceVersion.isAtLeast(`3.4 `) then GenCheckMode .Check
2775
2775
else if sourceVersion.isAtLeast(`3.2`) then GenCheckMode .CheckAndFilter
2776
2776
else GenCheckMode .FilterNow // filter on source version < 3.2, for backward compat
2777
2777
GenFrom (pat, subExpr(), checkMode)
Original file line number Diff line number Diff line change @@ -923,7 +923,13 @@ trait Checking {
923
923
|
924
924
|If $usage is intentional, this can be communicated by $fix,
925
925
|which $addendum. $rewriteMsg""" ),
926
- pos, warnFrom = `3.2`, errorFrom = `future`)
926
+ pos,
927
+ warnFrom = `3.2`,
928
+ // we tighten for-comprehension without `case` to error in 3.4,
929
+ // but we keep pat-defs as warnings for now ("@unchecked"),
930
+ // until we propose an alternative way to assert exhaustivity to the typechecker.
931
+ errorFrom = if isPatDef then `future` else `3.4`
932
+ )
927
933
false
928
934
}
929
935
You can’t perform that action at this time.
0 commit comments