Issue 14904 - [REG2.067.0] bad error message in reduce: 'Incompatible function/seed/element'
Summary: [REG2.067.0] bad error message in reduce: 'Incompatible function/seed/element'
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: diagnostic, pull
Depends on:
Blocks:
 
Reported: 2015-08-11 02:02 UTC by Timothee Cour
Modified: 2017-07-19 17:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Timothee Cour 2015-08-11 02:02:42 UTC
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
}
----
Comment 1 Kenji Hara 2015-08-13 10:29:44 UTC
This is a diagnostic regression introduced in Phobos change:
https://github.com/D-Programming-Language/phobos/pull/2060
Comment 3 github-bugzilla 2015-08-25 09:47:42 UTC
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'
Comment 4 github-bugzilla 2015-09-07 16:46:49 UTC
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
Comment 5 github-bugzilla 2017-07-19 17:43:46 UTC
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