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

           Summary: [CTFE] cannot cast dchar to char at compile time on AA
                    assignment
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: CTFE, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Kenji Hara <[email protected]> 2013-11-27 17:57:37 PST ---
From:
http://forum.dlang.org/post/[email protected]

Test case:

bool test()
{
    char[ubyte] toCharTmp;
    dchar letter = 'A';

    //char c = cast(char)letter;    // OK
    toCharTmp[0] = cast(char)letter;    // NG

    return true;
}
void main()
{
    enum ct = test();
}

Output:
test.d(7): Error: cannot cast letter to char at compile time
test.d(13):        called from here: test()

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

Reply via email to