https://d.puremagic.com/issues/show_bug.cgi?id=12502

           Summary: Some static array casts incorrectly rejected in safe
                    code
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: verylonglogin....@gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin....@gmail.com> 2014-04-01 
15:10:00 MSK ---
This code should compile:
---
void f() @safe
{
    const char[1] arr;
    auto a1 = cast(const(ubyte)[]) arr[]; // ok
    auto a2 = cast(const(char) []) arr; // ok
    auto a3 = cast(const(ubyte)[]) arr; // Error: cast from const(char[1]) to
const(ubyte)[] not allowed in safe code
}
---

Same as issue 11383 but for static arrays.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to