Avoid false FS1113 on inline instance members with class-scope self identifiers#19761
Avoid false FS1113 on inline instance members with class-scope self identifiers#19761Copilot wants to merge 2 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>
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.
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
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