[Issue 11451] import statements don't work when compiling several files at once

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 6 08:15:07 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11451



--- Comment #5 from Atila Neves <atila.neves at gmail.com> 2013-11-06 08:15:05 PST ---
(In reply to comment #4)
> D module system is tightly tied to the filesystem. When you change the root of
> import path, module names change by design / spec. All existing D projects that
> have packages define single "correct" import path for application to compile
> and assign module names relative to it, it is intended way to go.
> 
> Now that you say it, it is quite interesting that separate compilation works
> here. IMHO it shouldn't. For some reason compiling `dmd -c a.d` emits
> unqualified `U` symbol into symbol file, this is why it does work. As far as I
> understand, it really should emit a qualified one.

I know the module system is tied to the filesystem. I think it's an excellent
idea. I also understand that the module name changes depending on where you
compile it from. This is why when I'm at the root of the fictional project
above I import foo.bar.baz, not baz or bar.baz. That's all good, and it works
when I compile the files separately.

What doesn't work is compiling the files together, for some strange reason. I
went back to TDPL after I ran into this my understanding is that if you want to
control what name will be used to import it, then go ahead and use "module
blah". But that's not what I want, I want to use the directory structure.
Which, again, works when invoking dmd separately for each file but not when
passing multiple files in.

Am I missing something?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list