Bug 9208 – [ICE](func.c line 1205) with auto return in recursive function
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-26T03:11:00Z
Last change time
2013-01-03T01:19:28Z
Keywords
ice, pull
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2012-12-26T03:11:59Z
import std.array: array;
struct Foo(T) { Foo* next; }
auto bar(T)(in Foo!T* x) {
if (true) return [""];
return array(bar(x.next));
}
void main () {
bar!int(null);
}
DMD 2.061alpha gives:
Assertion failure: 'type == f' on line 1205 in file 'func.c'
Replacing "auto" with string[] the code compiles (despite a unrelated statement is not reachable warning).