Allow shorthand syntax for single-element tuples #6636
Unanswered
jez9999
asked this question in
Language Ideas
Replies: 2 comments 5 replies
-
See: #883 IMO, this use case is pretty weak. The names of the tuple don't affect documentation nor do they affect the names of the variables used for deconstruction. You're better off just using the version of |
Beta Was this translation helpful? Give feedback.
5 replies
-
Also see #5706 and its linked discussions for this particular use case. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I like to use this "single ValueTuple input param" syntax when defining callback
Func
arguments so I can name the input parameters:This works fine until I only want one input param. Unfortunately I can't just use this syntax to have
ValueTuple
s with names that only have one entry:Could C# support shorthand value tuples with a single element to support this use-case (and maybe a few others)? Idea for disambiguation - allow a trailing comma in tuple definitions. A two-, single- and zero-element tuple could then be:
Beta Was this translation helpful? Give feedback.
All reactions