This compiles but should not: -------------------- module main; import inc; class Foo {} void main() { auto f = new Foo(); } -------------------- module inc; class Foo {} --------------------
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.