http://d.puremagic.com/issues/show_bug.cgi?id=4597

           Summary: std.algorithm.filter fails with a const range
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: bra...@puremagic.com


--- Comment #0 from Brad Roberts <bra...@puremagic.com> 2010-08-07 22:29:10 PDT 
---
Index: std/algorithm.d
===================================================================
--- std/algorithm.d     (revision 1807)
+++ std/algorithm.d     (working copy)
@@ -830,6 +830,9 @@

     // With chain
     assert(equal(filter!overX(chain(a, nums)), [22, 42]));
+
+    const int[] list = [ 1, 2, 10, 11, 3, 4 ];
+    assert(equal(filter!overX(list), [ 1, 2, 10, 3, 4 ]));
 }

 // move

Adding that test produces the folling failure:
std/algorithm.d(737): Error: this is not mutable

That's the opSlice function of struct Filter:
            ref Filter opSlice()
            {
                return this;
            }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to