Bug 15400 – inconsistent local `import` behavior

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-12-03T02:46:32Z
Last change time
2024-12-13T18:45:58Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Ketmar Dark
Moved to GitHub: dmd#17736 →

Comments

Comment #0 by ketmar — 2015-12-03T02:46:32Z
this code compiles ok: void boo () { immutable std = 42; import std.conv; } but this one fails with "declaration z02.boo.std is already defined": void boo () { import std.conv; immutable std = 42; } i think both variants should have the same behavior: either both should work, or both should fail.
Comment #1 by robert.schadek — 2024-12-13T18:45:58Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17736 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB