-
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
Proposal: Type inferred default value #7737
Comments
I think it is better to leave the First, it is concise, not one time a 'function' another time a 'keyword'; Second, it is better to always write down, what default is returned; maybe one time it may be the class, the other time it may be a derived class. verbosity is one of the advantages of C#, just see the 'superfluid' For instanciation, like in the optional parameter above, it could really ease typing and reading the code. |
@lachbaer Your argument can be applied to |
@alrz Don't take me too literal, that's why I put function in hyphens :-) |
Moved to dotnet/csharplang#102 |
Currently, if you want to use default values you have to specify the exact type for
default
operator,However, compiler could infer the desirable type from the target,
#1419 rules can also help to infer the best type for the resultant default value.
The text was updated successfully, but these errors were encountered: