www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22817] New: [REG 2.099] Missing file gives misleading error

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

          Issue ID: 22817
           Summary: [REG 2.099] Missing file gives misleading error
                    message
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

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

Old behaviour
---
(stable) $ dmd foo.c
Error: module `foo` is in file 'foo.c' which cannot be read
---

New behaviour
---
(stable) $ ./generated/linux/release/64/dmd foo.c
Error: unable to read module `foo`
       Expected 'foo.c' or 'foo/package.d' in one of the following import
paths:
import path[0] = ./generated/linux/release/64/../../../../../druntime/import
import path[1] = ./generated/linux/release/64/../../../../../phobos

(stable) $ mkdir bar
(stable) $ touch bar/package.d
(stable) $ ./generated/linux/release/64/dmd bar.d
Error: unable to read module `bar`
       Expected 'bar.d' or 'bar/package.d' in one of the following import
paths:
import path[0] = ./generated/linux/release/64/../../../../../druntime/import
import path[1] = ./generated/linux/release/64/../../../../../phobos
---

--
Feb 22 2022