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

           Summary: Ref functions can't be template functions.
           Product: D
           Version: 2.020
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: minor
          Priority: P4
         Component: DMD
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Ref functions can't be template functions

I guess DMD parser failed to bind `ref' to ref functions if the template is
written in function template syntax.
It is not serious problem for me.


real t;
ref real f(S)(S rhs)
{
        size_t tmp;
        return t;
}

template g(S)
{
        ref real g(S rhs)
        {
                size_t tmp;
                return t;
        }
}

f(1.0);
// variable f!(double).f.tmp only parameters or foreach declarations can be ref

g(1.0)
// no problem


-- 

Reply via email to