D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6590 - mixed in case and default statements do not create a new scope
Summary: mixed in case and default statements do not create a new scope
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P3 normal
Assignee: No Owner
URL:
Keywords: industry
Depends on:
Blocks:
 
Reported: 2011-09-01 13:28 UTC by timon.gehr
Modified: 2024-12-13 17:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description timon.gehr 2011-09-01 13:28:03 UTC
consider

void main(){
    int x;
    switch(x){
        case 0: auto e=1; break;
        case 1: auto e=2; break; // fine
        default: auto e=3; break; // fine
    }
    switch(x){
        case 0: auto e=1; break;
        mixin("case 1:"); auto e=2; break; //error
        mixin("default:"); auto e=3; break;// error
    }
}

tested with DMD 2.054
Comment 1 Johan Engelen 2017-03-18 22:34:42 UTC
This bug is still present in DMD 2.073.1
Comment 2 dlangBugzillaToGithub 2024-12-13 17:56:19 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18367

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB