[Issue 6283] New: [CTFE][Regression 2.054] Failed to assign to AA using a constness-changed array as key

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 10 13:03:01 PDT 2011


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

           Summary: [CTFE][Regression 2.054] Failed to assign to AA using
                    a constness-changed array as key
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: kennytm at gmail.com


--- Comment #0 from kennytm at gmail.com 2011-07-10 12:57:54 PDT ---
Test case:


-----------------------------------
static assert( {
    immutable qq = "qq";
    string q = qq;   // <-- from immutable(char[]) to immutable(char)[]

    int[string] pieces = ["a":1];
    pieces[q] = 0;   // <-- can't interpret

    return true;
}() );
-----------------------------------
x.d(9): Error: cannot evaluate delegate pure nothrow bool()
{
immutable immutable(char[]) qq = "qq";
string q = qq;
int[string] pieces = ["a":1];
pieces[q] = 0;
return true;
}
() at compile time
x.d(1): Error: static assert  (delegate pure nothrow bool()
{
immutable immutable(char[]) qq = "qq";
string q = qq;
int[string] pieces = ["a":1];
pieces[q] = 0;
return true;
}
()) is not evaluatable at compile time
-----------------------------------

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


More information about the Digitalmars-d-bugs mailing list