Thread overview
[Issue 2719] New: func(ref X) does not match parameter types (X)
Mar 09, 2009
d-bugmail
Mar 09, 2009
d-bugmail
Mar 12, 2009
d-bugmail
March 09, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2719

           Summary: func(ref X) does not match parameter types (X)
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: kk_tnr@hotmail.com


DMD2.026 on Windows
See this code.

struct S{
}
void main(){
    S s;
    func(s); // work correctly
    func(retS()); //// should not be error.
}
void func(ref S s){
}
S retS(){
    S s;
    return(s);
}

I got this message.
function example.func(ref S s) does not match parameter types (S)
This is definitely a bug.


-- 

March 09, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2719





------- Comment #1 from gide@nwawudu.com  2009-03-09 17:49 -------
*** Bug 2721 has been marked as a duplicate of this bug. ***


-- 

March 12, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2719


kamm-removethis@incasoftware.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #2 from kamm-removethis@incasoftware.de  2009-03-12 04:03 -------
Though it's not in the spec yet, bug 2621 suggests that ref not binding to rvalues is intentional. Maybe reopen as a spec bug?


--