Bug 6307 – imported packages are visible everywhere

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-07-13T11:27:00Z
Last change time
2015-06-09T05:12:02Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
kamm-removethis

Comments

Comment #0 by kamm-removethis — 2011-07-13T11:27:34Z
import1.d: import std.stdint; // includes nothing else in std.* void main() { std.stdio.writeln("hello"); } import2.d: import std.stdio; dmd -c import1.d import2.d compiles without error. It should error on std.stdio in import1.d.
Comment #1 by kamm-removethis — 2011-07-13T11:33:47Z
Another test case using only a single file: import std.stdint; void bar() { import std.stdio; } void main() { std.stdio.writeln("foo"); } // expected error
Comment #2 by code — 2012-02-16T19:28:48Z
*** This issue has been marked as a duplicate of issue 313 ***