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



--- Comment #2 from [email protected] 2013-09-02 11:57:56 PDT ---
I think the "root" issue is that when the enum is first instantiated, the
compiler doesn't care what the "marked" type of the enum is, but rather, what
the actual (ctfe) memory points to.

//----
module test;

char[] cc()
{
    return cast(char[])"hello";
}

string ss()
{
    return cast(string)['a', 'b'];
}

void main()
{
    auto cc1 = cc; //*Should* duplicate
    auto cc2 = cc; //*Should* duplicate
    auto ss1 = ss; //Should *not* duplicate
    auto ss2 = ss; //Should *not* duplicate
    assert(cc1 !is cc2); //Failed to duplicate
    assert(ss1  is ss2); //Failed to not duplicate
}
//----

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

Reply via email to