[Issue 22742] New: Improve error message for missing module in object.imported

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 6 11:57:27 UTC 2022


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

          Issue ID: 22742
           Summary: Improve error message for missing module in
                    object.imported
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: tim.dlang at t-online.de

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

--


More information about the Digitalmars-d-bugs mailing list