www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22361] New: Failed import gives misleading error message

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

          Issue ID: 22361
           Summary: Failed import gives misleading error message
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: snarwin+bugzilla gmail.com

As of DMD 2.097.2, attempting to compile the following program:

---
import foo;
---

...results in the following error message when the file `foo.d` does not exist:

---
bug.d(1): Error: module `foo` is in file 'foo.d' which cannot be read
---

This error message is misleading. In particular, the statement that "module
`foo` is in file 'foo.d'" is false, since no file named 'foo.d' exists.

--
Oct 06 2021