[Issue 20240] New: BitArray inconsistently preserves bits past length
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Sep 25 07:13:14 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20240
Issue ID: 20240
Summary: BitArray inconsistently preserves bits past length
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P4
Component: phobos
Assignee: dlang-bugzilla at thecybershadow.net
Reporter: dlang-bugzilla at thecybershadow.net
//////////// test.d ///////////
import std.bitmanip;
void main()
{
BitArray ba;
ba.length = 1;
ba[0] = 1;
ba.length = 0;
ba.length = 1;
assert(ba[0] == 0); // OK
ba.length = 2;
ba[1] = 1;
ba.length = 1;
ba.length = 2;
assert(ba[1] == 0); // Fail
}
///////////////////////////////
--
More information about the Digitalmars-d-bugs
mailing list