Bug 3712 – Error message without filename or line numbers on invalid code
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
All
Creation time
2010-01-16T14:06:00Z
Last change time
2014-03-01T00:36:04Z
Keywords
diagnostic
Assigned to
nobody
Creator
nfxjfg
Comments
Comment #0 by nfxjfg — 2010-01-16T14:06:01Z
NOTE: this bug report is for dmd 1.055, but the list let's me select only up to dmd 1.054. I tested this only with dmd 1.055.
This is expected to fail, but it outputs an error message without any filename, line number, or other context. This makes finding the error location very hard.
Honestly, I don't even know why dmd has error report functions that apparently output error messages without location information.
This happens both with the patch for bug 3685 applied or not applied.
//compile with dmd -c
//fails with:
// Error: can only catch class objects, not 'void'
//No further error messages, no filename, no line number.
void foo(T)() {
try {
} catch (DmdFails e) {
}
}
void x() {
foo!(int)();
}
Comment #1 by clugdbug — 2010-05-06T14:28:41Z
The 'undefined identifier' message was present in 1.037 but disappeared in 1.038 or 1.039. It is still correctly present in D2. The remaining message without line number shouldn't appear at all.
Comment #2 by bugzilla — 2011-04-05T22:06:40Z
dmd 1.068 and 2.053 produce
test.d(3): Error: undefined identifier DmdFails
test.d(8): Error: template instance test.foo!(int) error instantiating