http://d.puremagic.com/issues/show_bug.cgi?id=5725



--- Comment #1 from bearophile_h...@eml.cc 2011-06-26 01:54:29 PDT ---
Related. This compiles with no errors, and maybe goes in infinite loop:

import std.stdio;
void main() {
    auto array = new int[270];
    foreach (ubyte i, ref x; array)
        x = i;
    writeln(array);
}


If the range of the fixed-sized array is larger than the max number that the
index can represent, then I suggest to raise a compile-time error, just like
this program does:

void main() {
   ubyte x = 270;
}

test.d(2): Error: cannot implicitly convert expression (270) of type int to
ubyte

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

Reply via email to