D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 22361 - Failed import gives misleading error message
Summary: Failed import gives misleading error message
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: diagnostic, pull
Depends on:
Blocks:
 
Reported: 2021-10-06 17:10 UTC by Paul Backus
Modified: 2021-10-08 11:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Paul Backus 2021-10-06 17:10:38 UTC
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.
Comment 1 Dlang Bot 2021-10-06 17:53:27 UTC
@pbackus created dlang/dmd pull request #13134 "Fix Issue 22361 - Failed import gives misleading error message" fixing this issue:

- Fix Issue 22361 - Failed import gives misleading error message

https://github.com/dlang/dmd/pull/13134
Comment 2 Dlang Bot 2021-10-08 11:03:16 UTC
dlang/dmd pull request #13134 "Fix Issue 22361 - Failed import gives misleading error message" was merged into master:

- 3d6c299862f2aaabd163fab4cdb55b0a1fb0ea57 by Paul Backus:
  Fix Issue 22361 - Failed import gives misleading error message

https://github.com/dlang/dmd/pull/13134