D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6723 - foreach (i, e; range) {} crash
Summary: foreach (i, e; range) {} crash
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: ice
: 6726 (view as issue list)
Depends on:
Blocks:
 
Reported: 2011-09-24 13:16 UTC by Kyle Foley
Modified: 2012-04-20 16:40 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kyle Foley 2011-09-24 13:16:37 UTC
The following crashes the compiler:

void main()
{
	import std.range;
	foreach (i, e; iota(1,2)) {}
}
Comment 1 Andrej Mitrovic 2011-09-24 16:54:55 UTC
It looks like I've ran into the same issue in bug 6726.
Comment 2 Andrej Mitrovic 2011-09-24 16:55:14 UTC
*** Issue 6726 has been marked as a duplicate of this issue. ***
Comment 3 Kenji Hara 2011-09-24 17:12:56 UTC
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 SomeDude 2012-04-20 16:23:59 UTC
On 2.059 Win32:

PS E:\DigitalMars\dmd2\samples> rdmd bug.d
bug.d(4): Error: cannot infer argument types
Comment 5 Andrej Mitrovic 2012-04-20 16:40:26 UTC
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).