[Issue 18517] Import order is not invariant

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 30 00:36:26 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18517

--- Comment #4 from Jonathan Marler <johnnymarler at gmail.com> ---
> I would expect that if a module is loaded via using the filesystem, and the module name doesn't match how it was found, then this should be an error. Anything else seems to strain your sanity!

I thought the same, even made a PR to fix this but was told that by Andrei that
Walter didn't want to integrate this restriction.

> In other words, if you pass the modules on the command line, then they can have non-matching filenames, but if they were found via the module name mapping to directories, they had better match the module name.

Agreed, but Walter and Andrei do not.  I believe this is the PR I created to
enforce this, https://github.com/dlang/dmd/pull/7878/files but Walter and
Andrei discussed this on their own and decided against it.

The unfortunate consequence is that now no matter what we do, you can get
different results if you compile different sets of modules, i.e.


dmd -c foo.d bar.d

can be different than

dmd -c foo.d
dmd -c bar.d

there's no way to make these behave the same with their decision not to enforce
this rule.  Seems ludicrous to me but not much I can do when they decide to
discuss these things behind close doors.

--


More information about the Digitalmars-d-bugs mailing list