Bug 22679 – "Error: identifier expected following `package'" when module has 'debug' in it's name

Status
RESOLVED
Resolution
INVALID
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-01-16T17:05:24Z
Last change time
2022-01-17T11:41:40Z
Assigned to
No Owner
Creator
dlang

Attachments

IDFilenameSummaryContent-TypeSize
1839test.dFile which fails to compiletext/x-dsrc87

Comments

Comment #0 by dlang — 2022-01-16T17:05:24Z
Created attachment 1839 File which fails to compile Hello, Having 'debug' in the module name results in dmd (2.098.1) and ldc2 (1.28.0, llvm-13) throwing out "Error: identifier expected following `package`" at a line in which the module declaration is present. I tested this on the following hardware: Devuan linux bookworm/sid x86_64 i5-3320M (ivybridge, Litte Edian) I attach an example file which throws said error. Sincerely, Mariusz Jakoniuk (jarmuszz)
Comment #1 by moonlightsentinel — 2022-01-16T18:12:15Z
See https://dlang.org/spec/module.html#module_declaration > Package and module names cannot be Keywords.
Comment #2 by dlang — 2022-01-17T11:41:40Z
(In reply to moonlightsentinel from comment #1) > See https://dlang.org/spec/module.html#module_declaration > > > Package and module names cannot be Keywords. Thank you for reply, I missed this one point in the spec. If this is an intended behavior, I think the error message should be changed as it is misleading and could cause a lot of unneeded hair-pulling. Sincerely, Mariusz Jakoniuk (jarmuszz)