Add tuple conversion-from-type and put ValueTuple text in one place#1570
Add tuple conversion-from-type and put ValueTuple text in one place#1570
Conversation
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
BillWagner
left a comment
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
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#.
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
|
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. |
There was a problem hiding this comment.
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.
This is largely copied from #1560, but reverting the "tuple expression" to "tuple literal" change, and adding another example in the implicit conversion section.