Summary: Appaling bug in associative arrays
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD

This program compiles and prints "Abc":

import std.stdio; 

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

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