[Issue 2619] New: Locally-instantiated structs are not instantiated locally

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 26 13:38:08 PST 2009


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

           Summary: Locally-instantiated structs are not instantiated
                    locally
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


struct A(alias F)
{
    int fun(int i) { return F(i); }
}

A!(F) makeA(alias F)() {return A!(F)(); }

void main()
{
    int x = 40;
    int fun(int i) { return x + i; }
    A!(fun) a = makeA!(fun)();
    a.fun(2);
}

function test.main.A!(fun).A.fun cannot get frame pointer to main

The struct should be instantiated locally and save the frame pointer to the
caller.


-- 



More information about the Digitalmars-d-bugs mailing list