Summary: Reinterpret cast of static to dynamic array doesn't
                    work in safe code
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Piotr Szturmaj <> 2011-10-23 06:54:44 PDT 
void main() @safe
    long[2] a;
    auto b = cast(ubyte[])a; // error
    auto c = cast(ubyte[])cast(long[])a; // works

main.d(4): Error: cast from long[2u] to ubyte[] not allowed in safe code

Without @safe mode there's no error.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to