[Issue 14904] New: bad error message in reduce: 'Incompatible function/seed/element'
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Aug 10 19:02:42 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14904
Issue ID: 14904
Summary: bad error message in reduce: 'Incompatible
function/seed/element'
Product: D
Version: D2
Hardware: x86
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: timothee.cour2 at gmail.com
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
}
----
--
More information about the Digitalmars-d-bugs
mailing list