-
Notifications
You must be signed in to change notification settings - Fork 4k
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
zero- and one-element tuples #16313
Comments
Doesn't the current tuple parser require a minimum of 2 values? |
@AdamSpeight2008 Yes. |
Why not align the other way, don't recognize deconstruction syntax with fewer than 2 elements? |
@bbarry Single-value tuples are necessary for primitive wrapper types. |
Would leveraging it for naming primitive return values be considered an abuse? (int id) SaveSomethingToDb(Something smth); instead of int SaveSomethingToDbAndReturnId(Something smth); |
I like how Swift handles "womples", they're effectively just the scalar value itself. So an |
Will the zero-tuple be explicitly referred to as unit anywhere? I'd love to see some support for this in the future, such as being able to use |
I think the type (and literal) for unit could be |
@gafter Is this tracking a compiler/API change or a language feature? If the latter, could you close or move to csharplang? |
Issue moved to dotnet/csharplang #883 via ZenHub |
To best align positional pattern-matching (which won't restrict the number of values being deconstructed) with tuples, please support zero-element and one-element tuple types and tuple expressions.
The text was updated successfully, but these errors were encountered: