[Issue 2954] Appalling bug in associative arrays (D2 only)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 13 23:51:12 PDT 2009


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
            Version|unspecified                 |2.020
             Blocks|                            |1934
            Summary|Appalling bug in            |Appalling bug in
                   |associative arrays          |associative arrays (D2
                   |                            |only)
         OS/Version|Linux                       |All


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2009-09-13 23:51:08 PDT ---
This test case, from bug 1934, is part of the same issue: index expressions for 
AAs don't have proper type checking. In the case below, it's not converting the 
string literal into a char[3], and consequently, bad code generation results. 
Both asserts fail.

void main()
{
    char[char[3]] ac;
    char[3] c = "abc";
    ac["abc"]='a';
    assert(ac[c]=='a');    

    char[dchar[3]] ad;
    dchar[3] d = "abc"d;
    ad["abc"d]='a';
    assert(ad[d]=='a');
}

-- 
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