Bug 20606 – Cannot cast non-mutable BitArray to void[], size_t[]

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-02-25T01:29:26Z
Last change time
2020-02-25T07:01:36Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel

Comments

Comment #0 by moonlightsentinel — 2020-02-25T01:29:26Z
BitArray's opCast does not work with const/immutable instances: import std.bitmanip : BitArray; void main() { BitArray m; const numbers = cast(size_t[]) m; const bytess = cast(void[]) m; // The following casts don't compile const BitArray c; const numbers = cast(const size_t[]) c; const bytess = cast(const void[]) c; immutable BitArray i; const numbers = cast(const size_t[]) i; const bytess = cast(const void[]) i; }
Comment #1 by dlang-bot — 2020-02-25T01:33:16Z
@MoonlightSentinel created dlang/phobos pull request #7405 "Fix Issue 20606 - Cannot cast non-mutable BitArray to void[], size_t[]" fixing this issue: - Fix Issue 20606 - Cannot cast non-mutable BitArray to void[], size_t[] https://github.com/dlang/phobos/pull/7405
Comment #2 by dlang-bot — 2020-02-25T07:01:36Z
dlang/phobos pull request #7405 "Fix Issue 20606 - Cannot cast non-mutable BitArray to void[], size_t[]" was merged into master: - 661eefd1a258f4f4c2f1821e70d645fe8ed1e4b3 by MoonlightSentinel: Fix Issue 20606 - Cannot cast non-mutable BitArray to void[], size_t[] https://github.com/dlang/phobos/pull/7405