http://d.puremagic.com/issues/show_bug.cgi?id=6092

           Summary: Can't cast primitive to same-sized static array
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: cbkbbej...@mailinator.com


--- Comment #0 from Nick Sabalausky <cbkbbej...@mailinator.com> 2011-06-02 
13:38:32 PDT ---
This works, and is a very useful trick:

struct Foo {uint f;}
void main(){
    Foo a;
    ubyte[] b = cast(ubyte[4])a;
}

However, the following generates an error:

void main(){
    uint a;
    ubyte[] b = cast(ubyte[4])a;
}

The error:
Error: e2ir: cannot cast a of type uint to type ubyte[4u]

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

Reply via email to