File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2771,7 +2771,7 @@ object Parsers {
27712771 atSpan(startOffset(pat), accept(LARROW )) {
27722772 val checkMode =
27732773 if casePat then GenCheckMode .FilterAlways
2774- else if sourceVersion.isAtLeast(`future `) then GenCheckMode .Check
2774+ else if sourceVersion.isAtLeast(`3.4 `) then GenCheckMode .Check
27752775 else if sourceVersion.isAtLeast(`3.2`) then GenCheckMode .CheckAndFilter
27762776 else GenCheckMode .FilterNow // filter on source version < 3.2, for backward compat
27772777 GenFrom (pat, subExpr(), checkMode)
Original file line number Diff line number Diff line change @@ -923,7 +923,13 @@ trait Checking {
923923 |
924924 |If $usage is intentional, this can be communicated by $fix,
925925 |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+ )
927933 false
928934 }
929935
You can’t perform that action at this time.
0 commit comments