[Issue 9208] New: [ICE](func.c line 1205) with auto return in recursive function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 26 03:12:00 PST 2012


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

           Summary: [ICE](func.c line 1205) with auto return in recursive
                    function
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-12-26 03:11:59 PST ---
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).

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


More information about the Digitalmars-d-bugs mailing list