Bug 6723 – foreach (i, e; range) {} crash

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-09-24T13:16:00Z
Last change time
2012-04-20T16:40:26Z
Keywords
ice
Assigned to
nobody
Creator
kyfolee

Comments

Comment #0 by kyfolee — 2011-09-24T13:16:37Z
The following crashes the compiler: void main() { import std.range; foreach (i, e; iota(1,2)) {} }
Comment #1 by andrej.mitrovich — 2011-09-24T16:54:55Z
It looks like I've ran into the same issue in bug 6726.
Comment #2 by andrej.mitrovich — 2011-09-24T16:55:14Z
*** Issue 6726 has been marked as a duplicate of this issue. ***
Comment #3 by k.hara.pg — 2011-09-24T17:12:56Z
This code works with git master. Maybe this issue was already fixed by following commit: https://github.com/D-Programming-Language/dmd/commit/569077b
Comment #4 by lovelydear — 2012-04-20T16:23:59Z
On 2.059 Win32: PS E:\DigitalMars\dmd2\samples> rdmd bug.d bug.d(4): Error: cannot infer argument types
Comment #5 by andrej.mitrovich — 2012-04-20T16:40:26Z
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).