[Issue 12504] New: Wrong 'cannot cover index range' error message
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 1 15:40:19 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12504
Summary: Wrong 'cannot cover index range' error message
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: diagnostic, rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2014-04-01 15:40:09 PDT ---
void main() {
int[256] data;
foreach (ubyte i; 0 .. data.length) {} // OK
foreach (ubyte i, x; data) {} // Error
}
test.d(4,5): Error: index type 'ubyte' cannot cover index range 0..256
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list