www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17699] New: Importing a module that has both modulename.d and

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

          Issue ID: 17699
           Summary: Importing a module that has both modulename.d and
                    modulename/package.d should be an error
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: schveiguy yahoo.com

This has happened to several people, and can be reproduced easily:

extract dmd 2.074.1
extract dmd 2.075.0 over it.

Write some code that imports std.datetime.

result: linker errors.

What is happening is 2.075 split std.datetime into a std.datetime package. This
creates a situation where both std/datetime.d and std/datetime/package.d exist.
The compiler imports the former and ignores the latter.

However, the library is built with only the package file, so the symbol
mangling is completely different for the new version.

I propose that if the compiler sees such a situation, it should throw an
ambiguity error instead of picking one or the other. This would at least
prevent such head-scratching errors.

--
Jul 27 2017