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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 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: -------