Bug 8937 – import declaration statement without scope after `if` imports to a parent scope

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-02T07:23:00Z
Last change time
2012-11-14T16:29:28Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2012-11-02T07:23:59Z
--- void main() { { static assert(!__traits(compiles, cos(0))); if(false) { static assert(!__traits(compiles, cos(0))); import std.math; static assert( __traits(compiles, cos(0))); } static assert(!__traits(compiles, cos(0))); if(true) // same for `if(false) { } else` import std.math; static assert(!__traits(compiles, cos(0))); // fails static assert(!__traits(compiles, cos(0))); // fails } static assert(!__traits(compiles, cos(0))); } ---
Comment #1 by k.hara.pg — 2012-11-03T00:54:30Z
Comment #2 by github-bugzilla — 2012-11-14T14:12:51Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b5f183e467ff3cbbffb0ffbff3a1038c2310675a fix Issue 8937 - import declaration statement without scope after `if` imports to a parent scope https://github.com/D-Programming-Language/dmd/commit/a227688faf8631a04bf5616b0fb77608f4edfcbe Merge pull request #1254 from 9rnsr/fix8937 Issue 8937 - import declaration statement without scope after `if` imports to a parent scope