[Issue 18712] [Reg 2.072] bogus "switch skips declaration" error with case in mixin
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue May 15 19:05:52 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18712
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Component|dmd |dlang.org
Resolution|WONTFIX |---
Severity|regression |normal
--- Comment #6 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to Rainer Schuetze from comment #5)
> Thanks for analyzing. I wouldn't be too concerned about possible breakage
> with a fix, because it's a regression (and a very recent if you compiled the
> code with -d).
It's not really a regression. The weirdness with the scope was always there,
it's just that nobody noticed it. When it was implemented, I'm sure nobody
thought about this behavior.
> It seems adding the implicit scope block in the parser is too early, as it
> doesn't know about mixins. OTOH it could be clarified in the spec that
> 'case' in mixins do not share the scope with trailing code.
A spec clarification is indeed in order:
https://github.com/dlang/dlang.org/pull/2368
Reopening as a spec issue. It is more than just mixins, as the other example I
posted here shows.
I investigated not adding the scope in the parser, but in the semantic() phase.
That just introduces even more subtle issues.
--
More information about the Digitalmars-d-bugs
mailing list