Thread overview
[Issue 9208] New: [ICE](func.c line 1205) with auto return in recursive function
Dec 26, 2012
Kenji Hara
Jan 03, 2013
Walter Bright
December 26, 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@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@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: -------
December 26, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9208


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, pull
           Platform|x86                         |All
         OS/Version|Windows                     |All


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-12-26 07:06:50 PST ---
https://github.com/D-Programming-Language/dmd/pull/1410

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 03, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9208



--- Comment #2 from github-bugzilla@puremagic.com 2013-01-03 00:42:37 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0e58a5ac9b87183c8ed396c0d570163bb0f6fdaf fix Issue 9208 - [ICE](func.c line 1205) with auto return in recursive function

https://github.com/D-Programming-Language/dmd/commit/b07e16196afa0bacb6335d33812e2ebb6a0fdfa6 Merge pull request #1410 from 9rnsr/fix9208

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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 03, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9208


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


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