Bug 3234 – Range comparison with array

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2009-08-07T15:56:00Z
Last change time
2015-06-09T01:26:26Z
Assigned to
nobody
Creator
Jesse.K.Phillips+D

Comments

Comment #0 by Jesse.K.Phillips+D — 2009-08-07T15:56:32Z
Comparisons between a range and a static array gave error. The error received is: Error: incompatible types for ((small) == ([1,2])): 'Filter!(result,int[])' and 'int[2u]' Example code provided by std.algorithms webpage: import std.algorithm; void main() { int[] arr = [ 1, 2, 3, 4, 5 ]; // Sum all elements auto small = filter!("a < 3")(arr); assert(small == [ 1, 2 ]); }
Comment #1 by yebblies — 2011-06-12T10:23:54Z
This was a documentation bug which has been fixed.