www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11627] New: [CTFE] cannot cast dchar to char at compile time on AA assignment

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



From:
http://forum.dlang.org/post/nvaqmtivvhrsaylzmscb forum.dlang.org

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: -------
Nov 27 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11627


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/2892

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 27 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11627




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/7832449ce04d430d851977e1cac2e5b9cd4e4ee5
fix Issue 11627 - [CTFE] cannot cast dchar to char at compile time on AA
assignment

https://github.com/D-Programming-Language/dmd/commit/f320b0f46448961231f84e8ec0f40f0b35384862


Issue 11627 - [CTFE] cannot cast dchar to char at compile time on AA assignment

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 30 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11627


Kenji Hara <k.hara.pg gmail.com> changed:

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


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