digitalmars.D.bugs - [Issue 12685] New: Refused foreach index type to span the whole
- via Digitalmars-d-bugs (25/25) Apr 30 2014 https://issues.dlang.org/show_bug.cgi?id=12685
https://issues.dlang.org/show_bug.cgi?id=12685 Issue ID: 12685 Summary: Refused foreach index type to span the whole range of the type Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Keywords: diagnostic, rejects-valid Severity: normal Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: bearophile_hugs eml.cc void main() { ubyte[2 ^^ 8] data1; foreach (ubyte i, x; data1) {} ushort[2 ^^ 16] data2; foreach (ushort i, x; data2) {} } DMD 2.066alpha gives false error messages: temp.d(3,5): Error: index type 'ubyte' cannot cover index range 0..256 temp.d(5,5): Error: index type 'ushort' cannot cover index range 0..65536 --
Apr 30 2014