test.d: ----- module test; import foo; import bar; void main() { auto x = RGB(0, 0, 255); } ----- foo.d: ----- module foo; struct RGB { ubyte r; ubyte g; ubyte b; } ----- bar.d: ----- module bar; package: import core.sys.windows.windows; ----- $ dmd -c test.d test.d(8): Error: foo.RGB at foo.d(4) conflicts with core.sys.windows.win dows.RGB at C:\dmd-git\dmd2\windows\bin\..\..\src\druntime\import\core\sy s\windows\windows.d(3213) If you remove the "package:" specifier, the error is gone. It's also unrelated to whether these modules are actually part of any package structure (the test-case is kept simple here). This does not appear to be a regression (tested up to 2.060).
Also this test-case is Windows-specific due to the windows import from druntime, I should have removed the dependency in the test-case..
Here's the new test-case without the win32 dependency: test.d: ----- module test; import foo; import bar; void main() { auto x = RGB(0, 0, 255); } ----- foo.d: ----- module foo; struct RGB { ubyte r, g, b; } ----- bar.d: ----- module bar; package: import doo; ----- doo.d: ----- struct RGB { ubyte r, g, b; } -----
The problem of course is that "package" has no real meaning for imports, and should therefore be ignored. In other words, this: ---- package: import abcd; ---- Should not mark the import as a package import (this has no meaning in the spec), it should stay as a private import unless typed differently, e.g.: ---- package: import abcd; // private import void foo() { } // package function ----
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18673 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB