-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pattern-matching changes for short tuples #30962
Comments
Fixes dotnet#30962 Unfortunately we cannot test binding `var ()` and `var (x)` until dotnet#30935 has been integrated
* Permit 0-element and 1-element tuple patterns Fixes dotnet#30962 Replaces dotnet#31027 * Handle null and nullable input for a var pattern with a tuple designation Fixes dotnet#30906 Replaces dotnet#30935 * Don't report missing Deconstruct when there is more than one applicable Deconstruct Fixes dotnet#31031
Currently, |
I don't understand what you are proposing should or should not be encouraged or supported. |
I'm saying that it should not be encouraged, as in, not suggesting in the error message (from #31056). and perhaps should not be supported at all, because of the confusion that it may create (later with the possible introduction of parenthesized patterns). |
…31056) * Permit the use of ITuple when Deconstruct exists but is ambiguous. * Permit 0-element and 1-element tuple patterns Fixes #30962 Replaces #31027 * Handle null and nullable input for a var pattern with a tuple designation Fixes #30906 Replaces #30935 * Don't report missing Deconstruct when there is more than one applicable Deconstruct Fixes #31031
Fixed in #31056 |
Adjust the implementation of pattern-matching to reflect LDM resolutions from 2018-11-05. The last point will be included in the changes for #20648.
Deconstruction vs ITuple
Proposed:
Deconstruct
, and satisfies theITuple
deconstruct constraints, useITuple
semanticsDeconstruct
semantics (instance or extension)Alternative
ITuple
deconstruct constraints, useITuple
semanticsIn both cases, 4. Error
Decision: Alternative
Proposed:
Conclusion: Approved
Proposed:
As part of this, I propose that we consider
System.ValueTuple<T>
instantitations to be considered tuple types. I do not propose any syntax changes related to this.As part of this, I propose that we consider
System.ValueTuple
to be considered a tuple type. I do not propose any syntax changes related to this.Conclusion: Approved
The text was updated successfully, but these errors were encountered: