The following crashes the compiler: void main() { import std.range; foreach (i, e; iota(1,2)) {} }
It looks like I've ran into the same issue in bug 6726.
*** Issue 6726 has been marked as a duplicate of this issue. ***
This code works with git master. Maybe this issue was already fixed by following commit: https://github.com/D-Programming-Language/dmd/commit/569077b
On 2.059 Win32: PS E:\DigitalMars\dmd2\samples> rdmd bug.d bug.d(4): Error: cannot infer argument types
Fixed. This used to crash but it doesn't anymore, now it's a compiler error (as it should be, there is no 'index' in input ranges).