Bug 3134 – Conflicting Class Names Permitted From Imported File

Status
RESOLVED
Resolution
INVALID
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
Windows
Creation time
2009-07-03T21:55:00Z
Last change time
2014-04-18T09:12:08Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
bus_dbugzilla

Comments

Comment #0 by bus_dbugzilla — 2009-07-03T21:55:23Z
This compiles but should not: -------------------- module main; import inc; class Foo {} void main() { auto f = new Foo(); } -------------------- module inc; class Foo {} --------------------
Comment #1 by code — 2012-02-12T19:00:21Z
Symbols defined in a module have precedence over imported symbols. You will only get an error if Foo was declared in two different imported modules.