Bug 22742 – Improve error message for missing module in object.imported

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-02-06T11:57:27Z
Last change time
2024-12-13T19:20:49Z
Assigned to
No Owner
Creator
Tim
Moved to GitHub: dmd#18083 →

Comments

Comment #0 by tim.dlang — 2022-02-06T11:57:27Z
Druntime master contains the new template imported, which allows to use symbols from a module without a normal import. The error message for a missing module currently only contains the location of the template in object.d, but the location, where imported is used, would also be useful. The following code demonstrates the problem: imported!q{std.missing}.Type var; DMD nightly currently generates the following output: /home/tim/Downloads/dmd.master.linux-2022-02-06/linux/bin64/../../src/druntime/import/object.d-mixin-4979(4979): Error: unable to read module `missing` /home/tim/Downloads/dmd.master.linux-2022-02-06/linux/bin64/../../src/druntime/import/object.d-mixin-4979(4979): Expected 'std/missing.d' or 'std/missing/package.d' in one of the following import paths: import path[0] = /home/tim/Downloads/dmd.master.linux-2022-02-06/linux/bin64/../../src/phobos import path[1] = /home/tim/Downloads/dmd.master.linux-2022-02-06/linux/bin64/../../src/druntime/import
Comment #1 by robert.schadek — 2024-12-13T19:20:49Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18083 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB