Bug 11848 – Crash on 'enum factorial5=(a=>a==0?1:a*__traits(parent,{})(a-1))(5);'

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-30T13:56:00Z
Last change time
2014-01-04T23:27:36Z
Keywords
ice
Assigned to
nobody
Creator
timon.gehr

Comments

Comment #0 by timon.gehr — 2013-12-30T13:56:13Z
DMD 2.064.2 crashes with a segmentation fault when run on the following code: enum factorial5=(a=>a==0?1:a*__traits(parent,{})(a-1))(5); The expected behaviour is a compile error, as type deduction cannot determine the return type.
Comment #1 by k.hara.pg — 2014-01-04T23:27:36Z
With git head: test.d(1): Error: forward reference to inferred return type of function call __traits(parent, function () { } )(a - 1) *** This issue has been marked as a duplicate of issue 10922 ***