4 fail_compilation/ice12174.d(12): Error: no property `sum` for `[1, 2, 3]` of type `int[]`
5 fail_compilation/ice12174.d(20): Error: CTFE failed because of previous errors in `this`
6 fail_compilation/ice12174.d(13): called from here: `filter([1, 2, 3])`
12 enum foo3
= (int n
) => [1,2,3].sum
;
13 enum bar3
= [1,2,3].filter
!(n
=> n
% foo3(n
) == 0);
16 template filter(alias pred
)
18 auto filter(Range
)(Range rs
)
20 return FilterResult
!(pred
, Range
)(rs
);
24 private struct FilterResult(alias pred
, R
)
31 while (_input
.length
&& !pred(_input
[0]))
33 _input
= _input
[1..$];
37 @property bool empty() { return _input
.length
== 0; }
39 @property auto ref front()
48 _input
= _input
[1..$];
49 } while (_input
.length
&& !pred(_input
[0]));