Bug 2719 – func(ref X) does not match parameter types (X)

Status
RESOLVED
Resolution
INVALID
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-03-09T13:04:00Z
Last change time
2015-06-09T01:31:15Z
Assigned to
bugzilla
Creator
kk_tnr

Comments

Comment #0 by kk_tnr — 2009-03-09T13:04:16Z
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.
Comment #1 by gide — 2009-03-09T17:49:14Z
*** Bug 2721 has been marked as a duplicate of this bug. ***
Comment #2 by kamm-removethis — 2009-03-12T04:03:19Z
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?