http://d.puremagic.com/issues/show_bug.cgi?id=7077
Summary: mixin statements can invade the enclosing scope Product: D Version: D2 Platform: Other OS/Version: All Status: NEW Keywords: accepts-invalid, rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: timon.g...@gmx.ch --- Comment #0 from timon.g...@gmx.ch 2011-12-07 05:16:20 PST --- compiles, should not compile: void main(){ if(0) mixin(q{auto x = 2;}); writeln(x); } does not compile, should compile: void main(){ if(0) mixin(q{auto x = 2;}); auto x = 1; } The workaround is to put {...} around the mixin statement. (For comparison, this does not compile: void main(){ if(0) auto x = 2; writeln(x); } And this does compile: void main(){ if(0) auto x = 2; auto x = 1; }) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------