[Issue 15216] New: Produce clearer error messages w.r.t. ref
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sat Oct 17 04:12:17 PDT 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15216
          Issue ID: 15216
           Summary: Produce clearer error messages w.r.t. ref
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: samjnaa at gmail.com
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"
}
--
    
    
More information about the Digitalmars-d-bugs
mailing list