[Issue 3051] New: Passing alias to member function does not work (1/2)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 4 11:43:38 PDT 2009


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

           Summary: Passing alias to member function does not work (1/2)
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


This is the first of two related bug reports.

class A
{
    A next;

    void fun(alias fun)()
    {
        assert(0);
    }

    void gun()
    {
        void hun(A a)
        {
        }
        next.fun!(hun)();
    }
}

Error: template instance cannot use local 'hun' as parameter to non-global
template fun(alias fun)

This might not work due to an implementation limitation in the current dmd (the
"this" pointer and the stack frame pointer compete for the same register), but
as the next bug will show, the code doesn't work even if said limitation is
worked around.

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


More information about the Digitalmars-d-bugs mailing list