http://d.puremagic.com/issues/show_bug.cgi?id=10928

           Summary: Fails to create closures that reference structs with
                    dtor
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Dmitry Olshansky <[email protected]> 2013-08-30 
07:58:43 PDT ---
To make example real simple:

struct D{
    int x;
    ~this()
    {

    }
}

void foo(D bar)
{
    (){ bar.x++; }();
}

void main()
{
    foo(D.init);
}

Note that even though there is no need for allocating closure at all.
Compiler should deal with such cases by tiying the lifetime of dtor-able
variables to that of a closure if one is indeed required.

This is critical as std.array.array and other functions started using internal
lambdas for trusted blocks making use of any RefCounted range impossible.

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

Reply via email to