You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I apologize for neglecting the form, but I see not how to fill "expected behavior" etc. correctly.
In C# 7, we currently are able to use the default keyword in the following way:
int x = default;
meaning int x = default(int);
We also can use tuple deconstruction like that:
(int x, bool y) = (42, true);
Or with the default keyword: (int x, bool y) = default((int, bool))
But what seems to be impossible to me at the moment is this pattern of syntax: (int x, bool y) = default;
In my eyes, the is some kind of logical gap that deserves to be filled soon. Okay, in this example, we could either write var (x, y) = default((int, bool))
But assume x and y have been declared already before, then the use of var keyword is not possible.
That's why I would like to propose allowing this syntax.
While enjoying this language for a few years now, I am new to this forum, so I would be thankful to someone explaining me what's happening next with this proposal - if not already submitted by another user, but I couldn't find one. Thank your for your attention!
The text was updated successfully, but these errors were encountered:
I think this is currently behaving as designed, which means this is a request to change the language, not the compiler. And such requests belong to the csharplang repo. Can you move this issue there and close it here?
Hi,
I apologize for neglecting the form, but I see not how to fill "expected behavior" etc. correctly.
In C# 7, we currently are able to use the
default
keyword in the following way:int x = default;
meaning
int x = default(int);
We also can use tuple deconstruction like that:
(int x, bool y) = (42, true);
Or with the default keyword:
(int x, bool y) = default((int, bool))
But what seems to be impossible to me at the moment is this pattern of syntax:
(int x, bool y) = default;
In my eyes, the is some kind of logical gap that deserves to be filled soon. Okay, in this example, we could either write
var (x, y) = default((int, bool))
But assume
x
andy
have been declared already before, then the use ofvar
keyword is not possible.That's why I would like to propose allowing this syntax.
While enjoying this language for a few years now, I am new to this forum, so I would be thankful to someone explaining me what's happening next with this proposal - if not already submitted by another user, but I couldn't find one. Thank your for your attention!
The text was updated successfully, but these errors were encountered: