Uh oh!
There was an error while loading. Please reload this page.
Parser: recover on missing 'when' conditions - #20071
Conversation
This comment has been minimized.
This comment has been minimized.
T-Gro
left a comment
There was a problem hiding this comment.
🤖 AI review (@expert-reviewer): no significant issues found. Please verify independently.
Reviewed the parser recovery for missing/invalid when guard expressions and the supporting refactor:
- The four new
parenPattern WHEN ...productions are correctly gated by%prec prec_recover, so they only engage when the normalWHEN declExprreduction fails; a valid guard still parses throughpatternGuard. The complementaryparenPattern patternGuard+recoverpath (guard present, result missing) remains handled by the existingpatternAndGuard recoverrules. patternResulttype change (Range→range option) andArrowRange = mArrowthreading are consistent; recovered clauses correctly emitArrowRange = Noneand anArbitraryAfterErrorresult node.mkMatchClauses/mkMatchClausesRecoverMissingResultpreserve the original range semantics (mLastOuter |> Option.defaultValue mLast,mNextBarcontinuation threading), matching the updated.bslbaselines.- Setting
guard = Nonein the missing-expression cases is appropriate since no valid guard expression exists, and the singleparsExpectingExpressiondiagnostic is reported at thewhenkeyword.
Baselines (Match - When 01–04, Try - With 09) look correct.
ff89428 to
2e152a0Compare❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
Warning No PR link found in some release notes, please consider adding it.
|
🔍 Tooling Safety Check — Affects-Compiler-Output
|
Uh oh!
There was an error while loading. Please reload this page.
Fixes parsing of missing
whenclause expressions, like the following: