Skip to content

Dedup format specifier locations in computation expressions#19791

Merged
T-Gro merged 7 commits into
mainfrom
fix/issue-16419
Jun 3, 2026
Merged

Dedup format specifier locations in computation expressions#19791
T-Gro merged 7 commits into
mainfrom
fix/issue-16419

Conversation

@T-Gro
Copy link
Copy Markdown
Member

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

Fixes #16419

Adds a HashSet guard in TcResultsSinkImpl.NotifyFormatSpecifierLocation to prevent duplicate entries when CE desugaring re-typechecks format strings.

T-Gro and others added 3 commits May 22, 2026 17:50
…e 16419)

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

github-actions Bot commented May 22, 2026

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label May 22, 2026
@T-Gro T-Gro requested a review from abonie May 22, 2026 19:27
Copy link
Copy Markdown
Member Author

@T-Gro T-Gro left a comment

Choose a reason for hiding this comment

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

Clean, minimal fix that correctly addresses the duplicate format specifier issue in computation expressions.

What I verified:

  • range is a struct with [<CustomEquality; NoComparison>] and proper Equals/GetHashCode overrides (ignoring synthetic/debug-point bits), so the default HashSet comparer works correctly here.
  • The dedup-via-HashSet pattern is already established in this class (capturedNameResolutionIdentifiers, capturedModulesAndNamespaces), so this is consistent.
  • No concern about numArgs being silently dropped — a format specifier at a given source location always resolves to the same arity, so deduplicating by range alone is sound.
  • Test clearly targets the exact repro scenario (format specifier inside seq CE).

LGTM 👍

@T-Gro T-Gro added the AI-reviewed PR reviewed by AI review council label May 25, 2026
@github-project-automation github-project-automation Bot moved this from New to In Progress in F# Compiler and Tooling May 26, 2026
@T-Gro
Copy link
Copy Markdown
Member Author

T-Gro commented May 28, 2026

@copilot : Pls add release notes.

Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 28, 2026

@copilot : Pls add release notes.

Added the release notes entry in docs/release-notes/.FSharp.Compiler.Service/11.0.100.md in commit be63ef7.

Copilot finished work on behalf of T-Gro May 28, 2026 09:48
@T-Gro T-Gro enabled auto-merge (squash) May 29, 2026 11:49
@github-actions github-actions Bot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label May 29, 2026
@T-Gro
Copy link
Copy Markdown
Member Author

T-Gro commented Jun 3, 2026

/azp run fsharp-ci

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Member

@auduchinok auduchinok left a comment

Choose a reason for hiding this comment

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

Same like in #19862, this feels wrong because it hides the actual problem instead of fixing it.

@T-Gro T-Gro merged commit eb038f0 into main Jun 3, 2026
50 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in F# Compiler and Tooling Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-reviewed PR reviewed by AI review council AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

GetFormatSpecifierLocationsAndArity returns duplicated entries in computation expressions

4 participants