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 } ----
This is a diagnostic regression introduced in Phobos change: https://github.com/D-Programming-Language/phobos/pull/2060
https://github.com/D-Programming-Language/phobos/pull/3580
Commits pushed to stable at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/6579c574bbcc53944a2060f3d1eadc1fa5516f51 fix Issue 14904 - bad error message in reduce: 'Incompatible function/seed/element' The verbose message is shown only when the given `fun` is actually valid. https://github.com/D-Programming-Language/phobos/commit/76a5087312382ff0b16840d4c2501dc8ba6abda0 Merge pull request #3580 from 9rnsr/fix14904 [REG2.067.0] Issue 14904 - bad error message in reduce: 'Incompatible function/seed/element'
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/6579c574bbcc53944a2060f3d1eadc1fa5516f51 fix Issue 14904 - bad error message in reduce: 'Incompatible function/seed/element' https://github.com/D-Programming-Language/phobos/commit/76a5087312382ff0b16840d4c2501dc8ba6abda0 Merge pull request #3580 from 9rnsr/fix14904
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/6579c574bbcc53944a2060f3d1eadc1fa5516f51 fix Issue 14904 - bad error message in reduce: 'Incompatible function/seed/element' https://github.com/dlang/phobos/commit/76a5087312382ff0b16840d4c2501dc8ba6abda0 Merge pull request #3580 from 9rnsr/fix14904