Consider the following two modules: 1. test.d:
module test; import lib.a; void main() { foo(); } 2. lib/a.d: module lib.a; extern(C) void foo() {}When compiled separately (dmd -c lib/a.d; dmd test.d a.o), the function in 'a.o' is mangled as 'foo', but the reference in 'test.o' is mangled as '_D3lib1a3fooFZv', which leads to a link error. I would expect both of them to be either plain C mangling, or fully qualified D (better). What is the reason for current behavior?