D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13655 - clarify that a ref parameter cannot bind to an rvalue
Summary: clarify that a ref parameter cannot bind to an rvalue
Status: RESOLVED DUPLICATE of issue 11529
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 enhancement
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2014-10-25 16:09 UTC by Shriramana Sharma
Modified: 2017-12-30 17:38 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Shriramana Sharma 2014-10-25 16:09:45 UTC
Hello. The following code:

ref int foo(ref int x) { return x ; }
void main () { foo(3) ; }

produces the error message:

"function rvalue_argument.foo (ref int x) is not callable using argument types (int)"

It would be more meaningful if this could be clarified on the lines of:

"argument ref int x of function rvalue_argument.foo cannot bind to an rvalue"
Comment 1 Nick Treleaven 2017-12-30 17:38:45 UTC

*** This issue has been marked as a duplicate of issue 11529 ***