Skip to content

Add tuple conversion-from-type and put ValueTuple text in one place#1570

Open
jskeet wants to merge 4 commits intodraft-v8from
tuple-conversions-and-valuetuple
Open

Add tuple conversion-from-type and put ValueTuple text in one place#1570
jskeet wants to merge 4 commits intodraft-v8from
tuple-conversions-and-valuetuple

Conversation

@jskeet
Copy link
Contributor

@jskeet jskeet commented 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.

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
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

I had a few comments, but overall this is good.

I did compare with #1560 and it looks like all the described portions have been added.

> var squares = (1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225);
> ```
>
> Then the 15th square (`225`) can be addressed as `squares.Item15`, `squares.Rest.Item8` and `squares.Rest.Rest.Item1`.
Copy link
Member

Choose a reason for hiding this comment

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

This may be a better location for the note I suggested on line 422 (or similar language). It's a good example on why using the names is much more convenient in C#.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed #1574 for this.

jskeet and others added 3 commits February 13, 2026 09:07
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
@jskeet
Copy link
Contributor Author

jskeet commented Feb 13, 2026

Will leave this for a few more days in case @MadsTorgersen or @Nigel-Ecma want to request changes, but otherwise I'll merge next week.

Copy link
Contributor

@Nigel-Ecma Nigel-Ecma left a comment

Choose a reason for hiding this comment

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

There seem to be issues with the attempt to slot the missing conversion into the existing text without addressing the issues with that existing text, as detailed in offline email. Until that is addressed I cannot say this PR is a valid step towards fixing tuple construction and the deconstruction of tuple-ish things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants