www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20241] New: BitArray.bitsSet ignores length

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

          Issue ID: 20241
           Summary: BitArray.bitsSet ignores length
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P4
         Component: phobos
          Assignee: dlang-bugzilla thecybershadow.net
          Reporter: dlang-bugzilla thecybershadow.net

//////////// test.d ////////////
import std.algorithm.comparison;
import std.bitmanip;

void main()
{
    BitArray ba;
    ba.length = 2;
    ba[1] = 1;
    ba.length = 1;
    assert(ba.bitsSet.empty);
}
////////////////////////////////

--
Sep 25 2019