Bug 8102 – Error messages that point to the line numbers that lack the ending semicolon
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-05-15T11:12:52Z
Last change time
2022-01-19T20:37:17Z
Keywords
diagnostic
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2012-05-15T11:12:52Z
class Foo {
int x
/* some comments */
// more comments
/+ even more comments +/
void bar(int x_) { x = x_; }
}
void main() {}
DMD 2.060alpha gives:
test.d(7): semicolon expected, not 'void'
But I'd like something more similar to this (similar to the error given by Clang):
test.d(2): error: expected ';' at end of declaration list
Note the line number, 2 instead of 7.
Comment #1 by andrej.mitrovich — 2014-02-14T01:56:45Z
*** Issue 12155 has been marked as a duplicate of this issue. ***
Comment #2 by bugzilla — 2022-01-19T19:44:23Z
For:
class Foo
{
int x
void bar() { }
}
It now prints:
test.d(7): Error: semicolon needed to end declaration of `x`, instead of `void`
test.d(5): `x` declared here
Comment #3 by destructionator — 2022-01-19T20:37:17Z