www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2852] New: Cannot pass temporary result by reference (regression)

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2852

           Summary: Cannot pass temporary result by reference (regression)
           Product: D
           Version: 2.026
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: 2korden gmail.com


Test code:

struct Rect
{
    int x,y,w,h;
}

void pass(ref Rect rect)
{
}

Rect get()
{
    return Rect();
}

void main()
{
    pass(get);
}

Note that this is a regression since DMD2.025


-- 
Apr 18 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2852





------- Comment #1 from 2korden gmail.com  2009-04-18 07:25 -------
Compiler output (dmd2.028):
test.d(17): Error: function test.pass (ref Rect rect) does not match parameter
types (Rect)
test.d(17): Error: get() is not an lvalue


-- 
Apr 18 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2852





------- Comment #2 from gide nwawudu.com  2009-04-19 07:11 -------
Looks like a deliberate change, see BUG 2621.


-- 
Apr 19 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2852



--- Comment #3 from Don <clugdbug yahoo.com.au> 2009-10-15 05:25:26 PDT ---
This is the same as bug 3167. Although this report is older, it's the later one 
which Walter commented on. So I'm closing this one.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 15 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2852


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |DUPLICATE


--- Comment #4 from Don <clugdbug yahoo.com.au> 2009-10-15 05:27:05 PDT ---
*** This issue has been marked as a duplicate of issue 3167 ***

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