D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15216 - Produce clearer error messages w.r.t. ref
Summary: Produce clearer error messages w.r.t. ref
Status: RESOLVED DUPLICATE of issue 13656
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-17 11:12 UTC by Shriramana Sharma
Modified: 2015-10-17 14:09 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Shriramana Sharma 2015-10-17 11:12:17 UTC
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 Shriramana Sharma 2015-10-17 14:09:13 UTC
Sorry, I totally forgot I had already filed this...

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