https://issues.dlang.org/show_bug.cgi?id=15086
Issue ID: 15086 Summary: import doesn't verify module declaration Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Keywords: accepts-invalid Severity: minor Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: ag0ae...@gmail.com foo.d: ---- import bar; pragma(msg, bar.name); ---- bar.d: ---- module baz; /* not bar */ enum name = __MODULE__; ---- `dmd -c foo.d` prints "baz". It should fail with "Error: module baz from file bar.d must be imported with 'import baz;'" as happens with `dmd -c foo.d bar.d`. --