www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22816] New: [REG 2.099] Parser reads files with other


          Issue ID: 22816
           Summary: [REG 2.099] Parser reads files with other extensions
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

If I compile `foo.c`, but rather `foo.d` exists instead, the parser will
compile *that* module instead.

(stable) $ ls foo*
ls: cannot access 'foo*': No such file or directory

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

(stable) $ touch foo.d
(stable) $ ./generated/linux/release/64/dmd -c foo.c
(stable) $ ls foo*
foo.d  foo.o

Worse, it'll still compile the file as if it were the extension you passed on
the command-line.  i.e: `dmd foo.c` will compile `foo.d` as a C file.

Feb 22 2022