[Issue 13775] [REG2.067a] Broken explicit casting of dynamic array slices of known size to static array of different type

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Feb 15 13:39:55 PST 2015


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

Martin Nowak <code at dawg.eu> changed:

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

--- Comment #19 from Martin Nowak <code at dawg.eu> ---
(In reply to Kenji Hara from comment #18)
> Read my comment #9. It was *accidentally* accepted in 2.066.1.

This code used to work even with 2.065.
Maybe the difference here is that it's a slice of a static array?

void bar(ubyte[2] v)
{
}

void foo(ubyte[16] ip)
{
    foreach (i; 0 .. 8)
        bar(cast(ubyte[2])ip[i*2 .. i*2+2]);
}

--


More information about the Digitalmars-d-bugs mailing list