Bug 11627 – [CTFE] cannot cast dchar to char at compile time on AA assignment
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-27T17:57:00Z
Last change time
2013-12-05T01:03:37Z
Keywords
CTFE, pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2013-11-27T17:57:37Z
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()