Bug 15216 – Produce clearer error messages w.r.t. ref
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-10-17T11:12:00Z
Last change time
2015-10-17T14:09:13Z
Assigned to
nobody
Creator
samjnaa
Comments
Comment #0 by samjnaa — 2015-10-17T11:12:17Z
ref int foo(ref int x) { return x ; }
void main ()
{
foo(3) ;
// Error: function rvalue_argument.foo (ref int x) is not callable using
argument types (int)
// Comment: "argument ref int x of function rvalue_argument.foo cannot bind
to an rvalue" would be clearer IMO
int i ;
ref ir = i ;
// Error: variable ref_type.main.ir only parameters or foreach declarations
can be ref
// Comment: after the variable name add a colon, and add ", return values"
after "parameters"
}
Comment #1 by samjnaa — 2015-10-17T14:09:13Z
Sorry, I totally forgot I had already filed this...
*** This issue has been marked as a duplicate of issue 13656 ***