digitalmars.D - Need advice on Error: package name conflicts with usage as a module
- Alexander (21/21) May 30 Now I'm just a few steps away from finishing the revival of the
- Paul Backus (4/11) May 31 The normal way to resolve this is to rename
- Alexander (5/9) May 31 Is this a common practice? My understanding is that package
Now I'm just a few steps away from finishing the revival of the project at https://github.com/rumbu13/windows-d, and I've run into an annoying problem. There is a **file** windows\win32\devices.d (module windows.win32.devices), and there are also files under the windows\win32\devices\ **directory** that declare modules like windows.win32.devices.XXX. So I need to rename the module in windows\win32\devices.d and probably move it into the devices\ subdirectory. Since this is a WinAPI projection, I'd like to pick a good replacement name for the module, but I have no idea what would make the most sense. devicesbase? devicesroot? devices_? And this isn't just a single file/module with this problem — there are a lot of them. Or is there a more elegant solution? P.S. This started as "OK, I'll fix one or two bugs and move on. A 15-minute adventure." Instead, I've spent an entire month rewriting the CLI metadata access layer into something reliable and easier to understand. But it was worth it: I now have compile-time checks that prevent a lot of bugs when accessing metadata tables.
May 30
On Sunday, 31 May 2026 at 03:51:18 UTC, Alexander wrote:Now I'm just a few steps away from finishing the revival of the project at https://github.com/rumbu13/windows-d, and I've run into an annoying problem. There is a **file** windows\win32\devices.d (module windows.win32.devices), and there are also files under the windows\win32\devices\ **directory** that declare modules like windows.win32.devices.XXX.The normal way to resolve this is to rename `windows\win32\devices.d` to `windows\win32\devices\package.d`. See https://dlang.org/spec/module.html#package-module for details.
May 31
On Sunday, 31 May 2026 at 14:37:04 UTC, Paul Backus wrote:The normal way to resolve this is to rename `windows\win32\devices.d` to `windows\win32\devices\package.d`. See https://dlang.org/spec/module.html#package-module for details.Is this a common practice? My understanding is that package modules are typically used as aggregators of public imports. If it doesn't create confusion for users, this seems like the best approach.
May 31








Alexander <roland.taverner gmail.com>