-
Notifications
You must be signed in to change notification settings - Fork 84
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
Expression-bodied members vs. expressions that return nothing #369
Comments
Jon will poke around to try to find other examples. |
Research notes as I go... There are 13 matches for "nothing" (case-insensitive) in the standard right now. Three of these are irrelevant - for the record, they are:
The remaining matches are all in expressions.md (somewhat predictably). They are:
All of those currently look okay to me - that is, of course, only searching for "nothing". An additional search for statement_expression may yield other places to consider, but a quick look at those didn't suggest anything immediately. Handing back to Nigel for other suggestions, whether of places to look for problems or closing the issue (or deferring to C# 7 so that we check again then). |
Moving this to C# 7.x, when some new places expression that may be classified as nothing get introduced. Then we need to look for places where nothing is currently not an option that needs to be considered and determine if now it needs to be… could be no such places of course but determining that may take non-trivial time. |
Will wait until #213 is merged before looking. I suspect it won't be fixed, but we can validate it's not worse. |
Checked now, before #795 is merged, admittedly - all of the above is still true. Will change the milestone to C# 8. |
v6 introduces expression-bodied members, v7 will introduce expression-bodied finalisers. In the former case result of the expression of the body may be classified as nothing (§12.2.1) if the return type of the method is
void
; in the latter case it may be the case that the result type must be classified as nothing.The introduction of at least the above two kinds of expression bodied members extends the places expressions whose result is classified as nothing may occur: §12.2.1 requires updating for v6 (and again for v7); it may impact how null conditionals are specified (PR #7, #251); and there could well be other places…
Let the hunt begin!
The text was updated successfully, but these errors were encountered: