digitalmars.D.bugs - [Issue 7077] New: mixin statements can invade the enclosing scope
- d-bugmail puremagic.com (38/38) Dec 07 2011 http://d.puremagic.com/issues/show_bug.cgi?id=7077
- d-bugmail puremagic.com (12/12) Jul 28 2013 http://d.puremagic.com/issues/show_bug.cgi?id=7077
- d-bugmail puremagic.com (14/14) Jul 29 2013 http://d.puremagic.com/issues/show_bug.cgi?id=7077
- d-bugmail puremagic.com (12/12) Jul 29 2013 http://d.puremagic.com/issues/show_bug.cgi?id=7077
- d-bugmail puremagic.com (13/13) Jul 29 2013 http://d.puremagic.com/issues/show_bug.cgi?id=7077
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: nobody puremagic.com ReportedBy: timon.gehr gmx.ch --- Comment #0 from timon.gehr 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: -------
Dec 07 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7077 hsteoh quickfur.ath.cx changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hsteoh quickfur.ath.cx --- Comment #1 from hsteoh quickfur.ath.cx 2013-07-28 16:15:08 PDT --- I thought the whole point of mixins is to insert declarations into the enclosing scope? Otherwise it would break mixins that insert, e.g., member declarations into classes. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 28 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7077 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull CC| |yebblies gmail.com --- Comment #2 from yebblies <yebblies gmail.com> 2013-07-29 19:16:31 EST --- Nah, `mixin("X")` should behave as close as possible to `X`, and here it is being injected into the wrong scope. The bug is actually IfStatement not creating a proper scope for the if-body. https://github.com/D-Programming-Language/dmd/pull/2402 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 29 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7077 --- Comment #3 from github-bugzilla puremagic.com 2013-07-29 04:43:18 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/1b3b8611661dd86190dca151bc8106fc694c3ac1 Fix Issue 7077 - mixin statements can invade the enclosing scope The if body should always be inside its own scope https://github.com/D-Programming-Language/dmd/commit/f1c47fbbb2688888d1c4f001d8d338a885704bfe Merge pull request #2402 from yebblies/issue7077 Fix Issue 7077 - mixin statements can invade the enclosing scope -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 29 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7077 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|D2 |D1 Summary|mixin statements can invade |(D1 only) mixin statements |the enclosing scope |can invade the enclosing | |scope --- Comment #4 from yebblies <yebblies gmail.com> 2013-07-29 21:46:32 EST --- Still exists in D1 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 29 2013