[Issue 15086] import doesn't verify module declaration

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 12 20:07:46 UTC 2018


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

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m

--- Comment #5 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
(In reply to Walter Bright from comment #4)
> Why is this "critical"? I'm not even convinced it's a bug at all. The
> language does, after all, allow module names to be different from file names.

Well, it's allowing you to import a module with the wrong name. So, I don't see
how it can really be argued that it isn't a bug, but I agree that it isn't
particularly critical.

Honestly, I think that it was a mistake to allow the module declaration to not
match the file name, but that can be argued, and we're stuck with it at this
point, since it's doubtful that changing it would be worth the breakage. Either
way, being allowed to import the same module with two different names doesn't
seem like it improves things, and the module declaration is supposed to be
giving the module its name, so as long as it's allowed to not match the file
name, I would fully expect importing using the file name to fail if it doesn't
match the module declaration.

--


More information about the Digitalmars-d-bugs mailing list