Dedup format specifier locations in computation expressions#19791
Merged
Conversation
…e 16419) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
❗ Release notes required
|
T-Gro
commented
May 25, 2026
Member
Author
T-Gro
left a comment
There was a problem hiding this comment.
Clean, minimal fix that correctly addresses the duplicate format specifier issue in computation expressions.
What I verified:
rangeis a struct with[<CustomEquality; NoComparison>]and properEquals/GetHashCodeoverrides (ignoring synthetic/debug-point bits), so the defaultHashSetcomparer works correctly here.- The dedup-via-HashSet pattern is already established in this class (
capturedNameResolutionIdentifiers,capturedModulesAndNamespaces), so this is consistent. - No concern about
numArgsbeing 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
seqCE).
LGTM 👍
abonie
approved these changes
May 26, 2026
Member
Author
|
@copilot : Pls add release notes. |
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Contributor
Added the release notes entry in |
Member
Author
|
/azp run fsharp-ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
auduchinok
suggested changes
Jun 3, 2026
Member
auduchinok
left a comment
There was a problem hiding this comment.
Same like in #19862, this feels wrong because it hides the actual problem instead of fixing it.
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.
Fixes #16419
Adds a HashSet guard in TcResultsSinkImpl.NotifyFormatSpecifierLocation to prevent duplicate entries when CE desugaring re-typechecks format strings.