[Issue 2460] New: Ref functions can't be template functions.
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Tue Nov 18 06:32:26 PST 2008
    
    
  
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: bugzilla at digitalmars.com
        ReportedBy: hskwk at inter7.jp
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
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list