Skip to content

Fix shouldBeParenthesizedInContext for Sequential in record fields (#17826)#19850

Open
T-Gro wants to merge 3 commits into
mainfrom
fix/issue-17826
Open

Fix shouldBeParenthesizedInContext for Sequential in record fields (#17826)#19850
T-Gro wants to merge 3 commits into
mainfrom
fix/issue-17826

Conversation

@T-Gro
Copy link
Copy Markdown
Member

@T-Gro T-Gro commented May 28, 2026

Fixes #17826

Summary

SynExpr.shouldBeParenthesizedInContext now returns rue for SynExpr.Sequential inside record (SynExpr.Record) and anonymous record (SynExpr.AnonRecd) field assignments. Without the parentheses, the semicolons are reparsed as field separators, silently changing semantics or producing parse errors.

Changes

  • Added a match arm in shouldBeParenthesizedInContext covering Sequential inside record/anon-record contexts
  • Added component tests covering both regular records and anonymous records with sequential expressions in field values
  • Added release notes entry

Copilot and others added 3 commits May 28, 2026 15:19
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…17826)

Adds a match arm so SynExpr.Sequential inside SynExpr.Record or
SynExpr.AnonRecd is reported as requiring its parentheses. Without
the parens the semicolon is reparsed as a field separator, silently
changing semantics or producing a parse error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

❗ Release notes required


✅ Found changes and release notes in following paths:

Warning

No PR link found in some release notes, please consider adding it.

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md No current pull request URL (#19850) found, please consider adding it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Parens must be kept around sequential exprs with semicolons in record field assignments

1 participant