www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9577] New: Crash on static array of function literals

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

           Summary: Crash on static array of function literals
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: argcc ya.ru



//DMD32 D Compiler v2.062 just crash on this without any messages:

import std.stdio;

int foo(int i)
{
    static int function (int)[] bar = 
        [
            function int(int j){return j+1;},
            function int(int j){return j+2;}
        ];

    return bar[i](i);
}

void main(string[] args)
{
    writeln(foo(1));
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 23 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9577


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



Simpler test case:


void main() {
    static int function(int)[] foo = [x => x];
    foo[0](0);
}

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