Update “tuple” handling – rebased#1560
Merged
BillWagner merged 2 commits intodotnet:tuple-researchfrom Feb 12, 2026
Merged
Conversation
Contributor
|
Discussion result 2026-02-11:
|
Contributor
|
@BillWagner will create a branch for this (after Nigel's pushed a whitespace change) so that we don't lose the work. |
jskeet
added a commit
that referenced
this pull request
Feb 12, 2026
This is largely copied from #1560, but reverting the "tuple expression" to "tuple literal" change, and adding another example in the implicit conversion section.
jskeet
added a commit
that referenced
this pull request
Feb 12, 2026
This is largely copied from #1560, but reverting the "tuple expression" to "tuple literal" change, and adding another example in the implicit conversion section.
jskeet
added a commit
that referenced
this pull request
Feb 12, 2026
ValueTuple is now *only* referenced in the "runtime representation" section (and the standard library). This text is largely copied from #1560, with changes of: - Reverting the "tuple expression" to "tuple literal" change - Adding another example in the implicit conversion section - Avoiding using "deconstructor" and "deconstructing assignment" as those are (for now) not defined
Member
|
Merging into feature branch See new PR #1572 which contains the commits from this PR. |
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.
Rebased version of PR #1538 after @jskeet moved some of the incidental changes (like proper subscripts) into the trunk in PR #1555
Addresses issue #1155
Replaces PR #1366, PR #1538
A “surgical” fix for issue 1155 was outlined and later tried in PR 1366 (spun off from an earlier PR), unfortunately it did not work (mea culpa). This PR is the less surgical fix…
As usual only files in
/standardneed be considered for review, other changes are largely machine-generated.Overview of the PR (this list is not guaranteed to be complete):
( <item>, <item>, … )occurs in multiple places in C# with different meanings, e.g. parameter lists and tuples. The original presentation of “tuples” covered three different meanings using a single set of grammar rules and associated text. Unfortunately certain restrictions, such as where a declaration_expression is valid, where omitted in this compound description. By separating out the three meanings into tuple_literal, local_deconstructing_declaration, and deconstructing_assignment the PR addresses these issues using a combination of grammar and text.ValueTupletypes (whose underlying implementation is left to the the implementation). The description of this requirement was distributed and incomplete; in particular while all tuples have a uniqueValueTuplerepresentation the reverse is not true and how to handle aValueTuplevalue which is not equivalent to a tuple was unfortunately omitted. The PR concentrates the relationship into one clause and covers the missing cases.nullas, though the value is unused, the discard has no type.(a, b) = (b, a);does not require tuple construction and deconstruction.In addition to these other issues were addressed as they came to light during development.