-
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
Support C#7 tuples as default values for optional parameters #16921
Comments
AFAIK the tuple Maybe one should consider the implementation of constant or native structure values being allowed to be used as optional parameters. Take a look at the following only mildly related issues: #16095 #15079 #4982 #5474 |
Optional Parameter require the default value to be a compile-time constant, as it stored in the metadata. |
This appears to be a C# language design proposal. Language design proposals should be opened for discussion on the csharplang mailing list, and if sufficient support is given, it should be submitted as a pull request to add a proposal in markdown at the csharplang repository. |
Oh jesus christ, not that mailing list again... |
@Unknown6656 Sound your voice in #16916 |
I'll go ahead and close this language issue. The current compiler behavior is by-design (tuples don't have a constant value, therefore cannot be used a default values for optional parameters). |
Version Used:
C#7 in VS2017RC3
Steps to Reproduce:
Right now the following code gives a compilation error:
Expected Behavior:
It should work as if the type of
bar
was the primitive type, since both of its constituent parts are clearly compile-time constant:3
andfalse
Actual Behavior:
The text was updated successfully, but these errors were encountered: