Bug 22816 – [REG 2.099] Parser reads files with other extensions

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-02-22T23:28:48Z
Last change time
2022-02-27T19:50:58Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2022-02-22T23:28:48Z
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 paths: 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.
Comment #1 by ibuclaw — 2022-02-22T23:33:35Z
Comment #2 by dlang-bot — 2022-02-23T00:22:08Z
@ibuclaw created dlang/dmd pull request #13707 "fix Issue 22816 - [REG 2.099] Parser reads files with other extensions" fixing this issue: - fix Issue 22816 - [REG 2.099] Parser reads files with other extensions https://github.com/dlang/dmd/pull/13707
Comment #3 by dlang-bot — 2022-02-23T07:12:45Z
dlang/dmd pull request #13707 "fix Issue 22816 - [REG 2.099] Parser reads files with other extensions" was merged into stable: - 0de1b4ac7d53287f2c3ea8d1209016f83083851d by Iain Buclaw: fix Issue 22816 - [REG 2.099] Parser reads files with other extensions https://github.com/dlang/dmd/pull/13707
Comment #4 by dlang-bot — 2022-02-24T19:33:15Z
dlang/dmd pull request #13713 "Add dshell tests for Issue 22816 and Issue 22817" was merged into stable: - 2a5a937eef2da521ef4bf4e50029de41799be5c0 by Iain Buclaw: Add dshell tests for Issue 22816 and Issue 22817 https://github.com/dlang/dmd/pull/13713
Comment #5 by dlang-bot — 2022-02-27T19:50:58Z
dlang/dmd pull request #13725 "Merge remote-tracking branch 'upstream/stable' into merge_stable" was merged into master: - a04cb14657ca824fbe98748387f470bece7f854e by Iain Buclaw: fix Issue 22816 - [REG 2.099] Parser reads files with other extensions - f5a4dc3175d18e88cea8d03166fb6dda8f1d7784 by Iain Buclaw: Add dshell tests for Issue 22816 and Issue 22817 (#13713) Add dshell tests for Issue 22816 and Issue 22817 Signed-off-by: Nicholas Wilson <[email protected]> Merged-on-behalf-of: Iain Buclaw <[email protected]> https://github.com/dlang/dmd/pull/13725