[Issue 603] Undocumented behaviour: case and default create a scope

Stewart Gordon smjg_1998 at yahoo.com
Fri Dec 15 05:03:51 PST 2006


d-bugmail at puremagic.com wrote:
> ------- Comment #1 from bugzilla at digitalmars.com  2006-12-15 03:10 -------
> What happens is the { } after the switch creates a new scope. The case and
> default statements are just labels. I believe the grammar implies this
> behavior, and no changes are necessary.

d.puremagic.com seems to be down at the moment - so I wonder if this'll 
make it there....

Your marking this INVALID is nonsense.  A bug is a bug, whether it's the 
spec or the compiler that's doing what you intended.  If the case and 
default statements weren't themselves creating scopes, then there would 
be no "undefined identifier" errors.

If the errors aren't coming up when you try my testcase, then DMD has an 
OS-version-dependent bug.

Stewart.


More information about the Digitalmars-d-bugs mailing list