-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
fix Issue 23586 - DMD forgets a variable was just declared #14747
Conversation
|
Thanks for your pull request, @ibuclaw! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#14747" |
|
Initial failures are due to However... dmd/compiler/src/dmd/statement.d Lines 290 to 326 in c5d192d
If |
|
Should this go to stable? |
On the one hand, I'd prefer if this had a little more battle testing done, and it's not actually fixing any regression. On the other, it does seem to be a small localized fix. |
|
Well your choice. Merge when you'r made your decision. |
|
The next beta is scheduled to be released on the 1st anyway. |
The grammar/relationship of labelled statements to case statements are:
So the code:
Should result in a tree that looks like (as per the grammar rules):
However, instead it's currently being parsed as:
Because both
caseanddefaultcase statements check whetherParseStatementFlags.curlyScopeis in effect to determine whether to only parse one statement, or a list of statements. This flag is removed when a labelled statement is being parsed - forward the flag on so that it will be correctly picked up.