Skip to content

Fix #3939: Hide compiler-generated auto-property symbols from Symbols API#19498

Open
T-Gro wants to merge 3 commits intomainfrom
fix/issue-3939-autoproperty-symbols
Open

Fix #3939: Hide compiler-generated auto-property symbols from Symbols API#19498
T-Gro wants to merge 3 commits intomainfrom
fix/issue-3939-autoproperty-symbols

Conversation

@T-Gro
Copy link
Copy Markdown
Member

@T-Gro T-Gro commented Mar 26, 2026

Fixes #3939

Auto-property desugaring (member val Foo = 123 with get, set) creates internal symbols (v setter parameter, Foo@ backing field) that leaked through GetAllUsesOfAllSymbolsInFile() with empty EnclosingEntity and misleading names.

Fix: Mark these compiler-generated identifiers with synthetic ranges (.MakeSynthetic()) in CheckDeclarations.fs, consistent with how other desugared constructs (computation expressions, record construction) handle this.

Test: Un-skipped and rewrote the previously-skipped test AutoProperty with get, set has property symbol 02 to verify the v symbol no longer appears. All 93 symbol tests pass.

@T-Gro T-Gro requested a review from a team as a code owner March 26, 2026 16:31
@T-Gro T-Gro added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Mar 26, 2026
@T-Gro T-Gro requested a review from abonie March 26, 2026 16:31
@T-Gro T-Gro enabled auto-merge (squash) March 26, 2026 16:31
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@T-Gro T-Gro force-pushed the fix/issue-3939-autoproperty-symbols branch from 6787bf3 to 291fb03 Compare March 26, 2026 16:41
… API

Fixes #3939

Mark the compiler-generated `v` setter parameter and backing field
identifiers in auto-property desugaring with synthetic ranges, so they
are excluded from GetAllUsesOfAllSymbolsInFile(). Previously these
internal symbols leaked through the API with empty EnclosingEntity
and misleading DisplayName/CompiledName values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@T-Gro T-Gro force-pushed the fix/issue-3939-autoproperty-symbols branch from 291fb03 to 32af463 Compare March 31, 2026 10:34
T-Gro and others added 2 commits April 3, 2026 12:49
…symbols

Remove compiler-generated auto-property backing fields and setter
parameter 'v' from expected symbol arrays in 'Test Project24 all symbols'
and 'Test symbol uses of properties with both getters and setters'.
These symbols are now correctly hidden by MakeSynthetic() ranges.

Also merge with latest main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Symbols API: Empy value is returned for auto-property binding

1 participant