Avoid false FS1113 on inline instance members with class-scope self identifiers#19761
Draft
Copilot wants to merge 5 commits into
Draft
Avoid false FS1113 on inline instance members with class-scope self identifiers#19761Copilot wants to merge 5 commits into
Copilot wants to merge 5 commits into
Conversation
Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/02501657-eda7-4d68-a5d4-af85e644c220 Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix FS1113 error with inline member in class scope
Avoid false FS1113 on inline instance members with class-scope self identifiers
May 18, 2026
T-Gro
approved these changes
May 20, 2026
Member
T-Gro
left a comment
There was a problem hiding this comment.
The fix is correct. Class-scope self identifiers (as self) produce UnknownValue in the optimizer representation, causing spurious FS1113 for inline members. Skipping the check for all members via not v.IsMember is sound because:
- Accessibility for inline members is already enforced by FS0044 at type-check time
- Partial optimizer data for members is expected (self-parameter handling) and doesn't indicate a broken inline
- The internal error at line 4217 still guards against truly unresolvable inline data
The test covers the three reported forms cleanly. LGTM.
Contributor
❗ Release notes required
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
/azp run fsharp-ci |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inline instance members in classes currently fail with FS1113 when a class-scope self identifier is present (
type C() as self = ...), even though the member body is valid. This change removes that false-positive path while preserving FS1113 behavior for non-member inline values.Compiler behavior change (Optimizer)
CheckInlineValueIsCompletenow skips theIsPartialExprVal/FS1113 check whenv.IsMemberis true.Regression coverage (ComponentTests)
MemberDeclarationscovering the three reported forms:_member self identifier