[Issue 12519] Some implicit array casts are missing

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon May 26 06:23:47 PDT 2014


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

Denis Shelomovskij <verylonglogin.reg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #2 from Denis Shelomovskij <verylonglogin.reg at gmail.com> ---
(In reply to Kenji Hara from comment #1)
> void[] is an array of untyped *mutable* data. So appending const data to
> mutable array will violate type system.

But `byte` has no indirections so `const byte` is convertible to `byte` and
this logically equivalent code is valid:
---
void main()
{
    void[] va;
    const byte[] cba;
    const byte[1] csba;
    byte[] tmp;
    tmp ~= cba;
    tmp ~= csba;
    va = tmp;
}
---

--


More information about the Digitalmars-d-bugs mailing list