Emit FS0755 for CompiledName on multi-value let-bindings#19924
Open
T-Gro wants to merge 5 commits into
Open
Conversation
…#6131) Tests assert FS0755 is emitted at type-check time when [<CompiledName>] is applied to a tuple/record/wildcard destructuring binding. These FAIL on current main; sprint 02 will make them GREEN. Baseline on main: 6 failed (the FS0755 tests), 4 succeeded (the still-compiles tests). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…6131) [<CompiledName(`X`)>] let a, b = 1, 2 silently propagated the same compiled name to every value introduced by the destructuring pattern, crashing later with FS0192 / FS2014 (duplicate IL entries) during IL writing. Detect destructuring patterns in TcNormalizedBinding (tuple/record/list/cons/or/ands/wild etc) and emit the existing FS0755 (tcCompiledNameAttributeMisused) diagnostic once, at the binding pattern range, during type checking. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…bindings (#6131) Adds 11.0.100 release-note entry. Pure docs/formatting follow-up to the type-checker fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…6131) Replace the ~30-line syntactic SynPat walker (isSimpleValBindingPat) in TcNormalizedBinding with a single Map.count valSchemes > 1 check inside MakeAndPublishVals. The post-generalization val schemes are the authoritative count of values published by the binding, so the check is exact instead of approximate. This removes false positives the walker produced (single-field record destructure, single-element array, single-binding cons, let a, _ = ...) and closes a false negative on let (x as y) = 1, which previously slipped through the walker and ICE'd in IlxGen.MergeOptions during IL writing. Negative tests added for single-value destructures and active-pattern function bindings; the let (x as y) = 1 regression is added to the positive set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
Warning No PR link found in some release notes, please consider adding it.
|
All 12 failing jobs on AzDO build 1456244 reported 'Unable to obtain an authenticated token for running job ... dnceng-public'. The 18 sibling jobs (Linux, MacOS, several Windows configs, CheckCodeFormatting) passed against the same commit, confirming the failures are infrastructure-only. Empty commit to force a new CI run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 #6131