D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18805 - crash in iteration.d
Summary: crash in iteration.d
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-27 21:56 UTC by jackb
Modified: 2020-03-21 03:56 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 jackb 2018-04-27 21:56:09 UTC
The following code causes a crash in iteration.d, line 3175:
    auto a = [1,2,3,4,5];
    writeln(a.fold!((x,y,z) => x-y+z));
I have D version 2.079.0.
Comment 1 basile-z 2018-05-18 18:40:55 UTC
This is not a crash, this is a compiler error due to the fact that your lambda is invalid. fold takes lambdas with 2 parameters.