[Issue 18517] Import order is not invariant

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18517

Iain Buclaw  changed:

   What|Removed |Added

   Priority|P1  |P3

--


[Issue 18517] Import order is not invariant

2018-10-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18517

--- Comment #5 from Steven Schveighoffer  ---
I wasn't a part of that conversation, but the "feature" makes no sense -- if
you want to import a module and it doesn't reside at the filename that you
import, then the system can't find that module. It doesn't make sense that the
compiler then "renames" the module after the file name.

Is the conversation listed somewhere on github or the forums? I'd like to
reopen that conversation.

--


[Issue 18517] Import order is not invariant

2018-10-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18517

--- Comment #4 from Jonathan Marler  ---
> 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.

--


[Issue 18517] Import order is not invariant

2018-10-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18517

--- Comment #3 from Steven Schveighoffer  ---
Hm... I didn't realize that the module identifier was not identical to the
filename. That is interesting. It's not clearly stated in this bug report that
this is a requirement to get the error to occur -- I thought it had something
to do with the fact that `thing` appears in both files.

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!

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.

--


[Issue 18517] Import order is not invariant

2018-10-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18517

--- Comment #2 from Walter Bright  ---
Jonathan Marler's Relevant Pull Requests:

Fix module/import order invariance:

https://github.com/dlang/dmd/pull/7900

Interpret imports the same regardless of other modules passed on the command
line:

https://github.com/dlang/dmd/pull/7878

Add broken import order invariance tests:

https://github.com/dlang/dmd/pull/8165

Deprecate import/module name mismatch (ALL CASES):

https://github.com/dlang/dmd/pull/7778

--


[Issue 18517] Import order is not invariant

2018-10-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18517

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com
   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=15086

--


[Issue 18517] Import order is not invariant

2018-10-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18517

Steven Schveighoffer  changed:

   What|Removed |Added

 CC||schvei...@yahoo.com
   Severity|enhancement |normal

--


[Issue 18517] Import order is not invariant

2018-05-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18517

--- Comment #1 from Jonathan Marler  ---
Added 2 tests to dmd for this bug here: https://github.com/dlang/dmd/pull/8165
but the PR was rejected. Razvan doesn't think tests should be pushed to dmd by
themselves (without their corresponding fixes).

> Razvan: I don't see much benefit in having tests that don't pass in the test 
> suite. This puts a burden on the autotester and encourages people to make PRs 
> just with tests creating a separation between the fix and the test.

--