Bug 8825 – Wrong line number of error message

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-15T08:38:00Z
Last change time
2013-11-24T02:42:22Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
youxkei

Comments

Comment #0 by youxkei — 2012-10-15T08:38:25Z
Code: template t(alias a){ alias int t; } void main(){ t!(foo // line 6 ) i; // line 12 return; } Compilation output: main.d(12): Error: undefined identifier foo The line number of the error message is wrong. It is 12, but should be 6.
Comment #1 by k.hara.pg — 2013-08-21T20:50:22Z
Comment #2 by github-bugzilla — 2013-09-21T00:50:08Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3ad9c76c0d553b20f417f166ee9e35cc1d7994ee fix Issue 8825 - Wrong line number of error message - Each tokens should have its own 'loc'. - Rename `Lexer::loc` to `scanloc` to avoid misuse of lookahead-loc.