https://issues.dlang.org/show_bug.cgi?id=15179
Jesse Phillips <jesse.k.phillip...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jesse.k.phillip...@gmail.co | |m --- Comment #4 from Jesse Phillips <jesse.k.phillip...@gmail.com> --- (In reply to Walter Bright from comment #3) > Probably not going to change the import lookup rules for this case. Consider: Module bar provides a function, foobar, that takes an int. ---------- module bar; bool foobar(int i) { return true; } ---------- Module foo defines foobar to take a string. ---------- module foo; bool foobar(string m) { return false; } ---------- Main calls bar.foobar and the assertion passes. ---------- import bar; void main() { import foo; assert(7.foobar); } ---------- Module foo is modified, it now defines a function, foobar, that takes an int. ---------- module foo; bool foobar(string m) { return false; } /// Highjack call to bar.foobar bool foobar(int m) { return false; } ---------- The assertion will now fail in main due to function highjacking (no compiler error): $ rdmd test.d .\foo.d .\bar.d core.exception.AssertError@test.d(5): Assertion failure --