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).
Comment #1 by k.hara.pg — 2012-12-26T07:06:50Z
Comment #2 by github-bugzilla — 2013-01-03T00:42:37Z
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