Bug 2852 – Cannot pass temporary result by reference (regression)
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-04-18T07:11:00Z
Last change time
2015-06-09T01:18:23Z
Keywords
rejects-valid
Assigned to
nobody
Creator
2korden
Comments
Comment #0 by 2korden — 2009-04-18T07:11:51Z
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
Comment #1 by 2korden — 2009-04-18T07:25:13Z
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
Comment #2 by gide — 2009-04-19T07:11:52Z
Looks like a deliberate change, see BUG 2621.
Comment #3 by clugdbug — 2009-10-15T05:25:26Z
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.
Comment #4 by clugdbug — 2009-10-15T05:27:05Z
*** This issue has been marked as a duplicate of issue 3167 ***