Skip to content

Parser: recover on unfinished abstract members - #20070

Merged
T-Gro merged 4 commits into
dotnet:mainfrom
auduchinok:parser-abstractMember
Aug 12, 2026
Merged

Parser: recover on unfinished abstract members#20070
T-Gro merged 4 commits into
dotnet:mainfrom
auduchinok:parser-abstractMember

Conversation

@auduchinok

Copy link
Copy Markdown
Member

Fixes parsing of various unfinished abstract members, like the following:

typeT=abstractP:

@auduchinok
auduchinok requested a review from a team as a code ownerJuly 21, 2026 08:56
@auduchinok
auduchinokforce-pushed the parser-abstractMember branch from 103396b to 69339b8CompareJuly 21, 2026 09:55
@github-actionsgithub-actionsBot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label Jul 21, 2026
@auduchinok
auduchinokforce-pushed the parser-abstractMember branch from 69339b8 to 4aefde1CompareJuly 24, 2026 11:36
@auduchinok

auduchinok commented Jul 24, 2026

Copy link
Copy Markdown
MemberAuthor

@T-Gro There seems to be an issue with posting the release notes comment, could you please take a look?

@github-actionsgithub-actionsBot added the ⚠️ Affects-Compiler-Output Tooling check: PR touches IL emission or codegen label Jul 24, 2026
@github-actions

This comment has been minimized.

@NatElkins

Copy link
Copy Markdown
Contributor

@auduchinok See #20081

@T-GroT-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI review (@expert-reviewer): no significant issues found. Please verify independently.

Reviewed the parser error-recovery changes for unfinished abstract members:

  • mkAbstractMember extraction (ParseHelpers.fs) faithfully preserves the original inline grammar action. Since all four classDefnMember productions share the same opt_attributes opt_access abstractMemberFlags opt_access opt_inline prefix, the rhs parseState 1/2 ranges and grabXmlDoc positions remain consistent when called from every rule.
  • CheckDeclarations.fs guard (id.idText <> "") correctly skips only the fully name-less recovery slot (the recover production with no nameop). Named-but-typeless recovery still flows through TcAndPublishValSpec with a SynType.FromParseError type, preserving IDE tooling info. No valid member (including operator names via nameop) yields an empty idText, so nothing legitimate is filtered.
  • No correctness, security, or performance concerns identified. Full Azure fsharp-ci passes, including CheckCodeFormatting (grammar compiles with no new conflicts), and SyntaxTree baselines cover the new recovery cases.

@github-project-automationgithub-project-automationBot moved this from New to In Progress in F# Compiler and ToolingAug 3, 2026
@T-GroT-Gro added the AI-reviewed PR reviewed by AI review council label Aug 3, 2026
@T-Gro
T-Gro self-requested a review August 3, 2026 19:13
@github-actions

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Change pathRelease notes pathDescription
`src/Compiler`docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Tooling Safety Check — Affects-Compiler-Output
Affects-Compiler-Output: modifies pars.fsy / ParseHelpers (parser recovery)

Generated by PR Tooling Safety Check · opus46 5.7M ·

@auduchinok

Copy link
Copy Markdown
MemberAuthor

This is ready.

@T-Gro
T-Gro merged commit ce9b62a into dotnet:mainAug 12, 2026
48 checks passed
@github-project-automationgithub-project-automationBot moved this from In Progress to Done in F# Compiler and ToolingAug 12, 2026
@auduchinok
auduchinok deleted the parser-abstractMember branch August 12, 2026 08:43
T-Gro added a commit to gusty/fsharp that referenced this pull request Aug 18, 2026
Post-merge baseline drift, two independent causes:
- 7 SyntaxTree parse baselines (Member/Abstract - Method 01/02,
Abstract - Property 06/07/08/09, SynType/SynTypeAppNestedMultilineClosingGreaterAligned):
main's dotnet#20070 ("Parser: recover on unfinished abstract members") added/updated
these AFTER this branch last regenerated, emitting the old SynComponentInfo.longId
shape `[T]`. This branch's SynComponentInfo.longId->synType change now prints
`Some (LongIdent (SynLongIdent ([T], [], [None])))`. Pure representation change,
consistent with the ~300 baselines already updated by this PR.
- neg88.bsl (typecheck negative test): the SRTP constraint-solver changes shift the
surfaced unification failure from FS0001 at the argument to FS0043 at the call site
(+ an FS0193 for the fully-applied map3). All three invalid SRTP calls still error,
so the negative test still correctly rejects the code; only the error shape changed.
Regenerated baseline verified byte-for-byte against the net472 CI actual.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1389e318-3aed-41ba-8b6a-e2eaa465b0d6
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ Affects-Compiler-OutputTooling check: PR touches IL emission or codegenAI-reviewedPR reviewed by AI review councilAI-Tooling-Check-Scanned-CleanTooling check: diff analyzed, no interesting infrastructure files

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants

@auduchinok@NatElkins@T-Gro