Bug 12155 – Better line and column numbers for missing semicolon
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-13T17:54:00Z
Last change time
2014-02-15T07:55:14Z
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2014-02-13T17:54:55Z
D forces on the programmer the burden to end lines of code with a semicolon (unline Scala, Go and other language), this is supposed to offer better error messages. But if I forget a semicolon in this code:
import std.stdio;
void main() {
writeln("hello ")
/*
...
*/
// ...
writeln("world");
}
Using the -vcolumns dmd switch I receive this error message:
test.d(8,5): Error: found 'writeln' when expecting ';' following statement
In such cases I'd like the compiler to give an error message with line number and column number closer to where the semicolon should go, to help me fix the code faster:
test.d(3,21): Error: found 'writeln' when expecting ';' following statement
Comment #1 by andrej.mitrovich — 2014-02-14T01:56:42Z
*** This issue has been marked as a duplicate of issue 8102 ***
Comment #2 by yebblies — 2014-02-15T07:25:04Z
Bearophile - the only person around who constantly re-reports their own bugs.
Comment #3 by andrej.mitrovich — 2014-02-15T07:55:14Z
(In reply to comment #2)
> Bearophile - the only person around who constantly re-reports their own bugs.
So much so that I have a special entry for his bugs in my speed dial in my browser. :P