https://d.puremagic.com/issues/show_bug.cgi?id=11733

           Summary: Refuse int indexing of associative arrays with char
                    keys
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2013-12-12 10:11:20 PST ---
I think this code should be disallowed:


void main() {
    int[char] aa1;
    int[dchar] aa2;
    auto r1 = aa1[0];
    auto r2 = aa2[0];
}


dmd 2.065alpha compiles it with no errors, and gives at run-time:

core.exception.RangeError@temp(4): Range violation

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

Reply via email to