https://issues.dlang.org/show_bug.cgi?id=15202

          Issue ID: 15202
           Summary: filter and randomCover do not work together
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: [email protected]
          Reporter: [email protected]

---
  int val = [1,2,3]
    .randomCover
    .filter!(x => x > 99)
    .front;
---

I would expect that to fail -- there is no element greater than 99.
Instead, it randomly retrieves one of the 3 values, ignoring the filter.

--

Reply via email to