www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11848] New: Crash on 'enum factorial5=(a=>a==0?1:a*__traits(parent,{})(a-1))(5);'

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11848

           Summary: Crash on 'enum
                    factorial5=(a=>a==0?1:a*__traits(parent,{})(a-1))(5);'
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch


--- Comment #0 from timon.gehr gmx.ch 2013-12-30 13:56:13 PST ---
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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 30 2013
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11848


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2014-01-04 23:27:36 PST ---
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 ***

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