-
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
return, break and continue expressions #20269
Conversation
@sharwell This is not "for personal review only". I'd actually like this to be reviewed if it gets past the ldm. |
4cf8969
to
4f0ef86
Compare
@alrz I will bring this up in LDM next week. I'd suggest waiting for feedback from LDM before investing more time in code (the prototype you have so far will help though). If supportive, I expect LDM will focus on language questions first (do we want this in the language? how does it fit and how is it spec'ed?). After that I will expect there will be scheduling questions (as we'll need to cover semantic model APIs, IDE scenarios such as completion and colorizing, and more). |
LDM discussed this briefly, but did not come to a conclusion. The next session is in 3 or 4 weeks. Hold on. |
Since there is no language proposal for this feature yet I'll close this untill LDM confirm. |
4f0ef86
to
004ad40
Compare
bool hasErrors = false; | ||
if (!IsJumpExpressionInProperContext(node)) | ||
{ | ||
diagnostics.Add(ErrorCode.ERR_ThrowMisplaced, node.ReturnKeyword.GetLocation()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I change ERR_ThrowMispalced
message to A {0} expression is not allowed in this context.
to be used for all jump expressions?
@@ -13,6 +13,7 @@ internal enum ConversionKind : byte | |||
ImplicitNumeric, | |||
ImplicitEnumeration, | |||
ImplicitThrow, | |||
ImplicitJump, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we merge ImplicitThrow
and ImplicitJump
together? (one issue is IsThrow public property)
<Rule Id="RS0022" Action="Error" /> | ||
<Rule Id="RS0024" Action="Error" /> | ||
<Rule Id="RS0025" Action="Error" /> | ||
<Rule Id="RS0026" Action="Error" /> | ||
<Rule Id="RS0027" Action="Error" /> | ||
<Rule Id="RS0027" Action="None" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is disabled to make return-expression's expression optional; , otherwise it complains about the default parameter. (bug?)
@alrz Thanks for your patience. To give you a heads-up, the csharplang championed issue was pushed until after 8.0 in terms of priority. I'll let you check out today's LDM notes for more details, once they are published. |
@alrz I used the blocked label instead as a way to indicate this is not ready to merge. I'm trying to make sure as many Community PRs get merged as possible and the more focused I can make my search results, the less likely I'll be to miss one that could have been merged. 😄 |
Since the LDM has not approved any such language feature, we cannot accept this PR. |
Correction: this has a champion. |
LDM discussed this feature yesterday and decided we do not want to do the feature. |
Prototype for dotnet/csharplang#176