Now I can say, it is not my code that is illegal. I gave dmd with another source file order a try. Putting my module "B" at the last position. And it works. But now I know, the feature is not reliable. I will encounter more problems in future. And I cannot tell /build/ in which order is should list the source files :( I will make a bug report.