Bug 14904 – [REG2.067.0] bad error message in reduce: 'Incompatible function/seed/element'
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-08-11T02:02:00Z
Last change time
2017-07-19T17:43:46Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
timothee.cour2
Comments
Comment #0 by timothee.cour2 — 2015-08-11T02:02:42Z
dmd_066 -c -o- main.d:
Error: 'fabs' is not defined, perhaps you need to import std.math; ?
dmd_068 -c -o- main.d:
Error: static assert "Incompatible function/seed/element: main.__lambda1/double/double"
main.d:
----
void main(){
import std.algorithm;
// import std.math;
double[]x=[1,2,3];
auto b=double(0).reduce!((a, b) => a + fabs(b))(x);//bad message with 2.068
//auto b=x.reduce!((a, b) => a + fabs(b)); //ok: Error: 'fabs' is not defined
}
----