[Issue 13655] New: clarify that a ref parameter cannot bind to an rvalue
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Oct 25 09:09:45 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13655
Issue ID: 13655
Summary: clarify that a ref parameter cannot bind to an rvalue
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Keywords: diagnostic
Severity: enhancement
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: samjnaa at gmail.com
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"
--
More information about the Digitalmars-d-bugs
mailing list