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

           Summary: Appaling bug in associative arrays
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: bugzi...@digitalmars.com
        ReportedBy: and...@metalanguage.com


This program compiles and prints "Abc":

import std.stdio; 

void main() {
    uint[string] hash;
    char[] a = "abc".dup;
    hash[a] = 42;
    a[0] = 'A';
    writeln(hash.keys);
}

It should not compile because char[] is obviously not convertible to string. By
this I am also reiterating the necessity to make associative arrays a true
library type and have the compiler rewrite the literals and the type name to
use that library type.


-- 

Reply via email to