Bug 8598 – [regression 2.059] Calling template function doesn't print instantiated line number
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-08-29T06:00:00Z
Last change time
2015-06-09T05:11:46Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2012-08-29T06:00:18Z
This is an example code that has an error.
import std.stdio;
import std.algorithm;
import std.range;
import std.conv;
void main()
{
"123".map(x => x.to!string).join("\n").writeln; // test.d line 8
// ^ lack of '!'
}
Output:
C:\dmd2\src\phobos\std\algorithm.d(367): Error: template std.algorithm.map(fun...) if (fun.length >= 1) is not a function template
C:\dmd2\src\phobos\std\algorithm.d(367): Error: template std.algorithm.map(fun...) if (fun.length >= 1) cannot deduce template function from argument types !()(string,void)
But, compiler should print second error "... cannot deduce template function from ..." with the position test.d(8).
This is a regression of 2.059 which introduced by fixing bug 7768 and pull #839.