Two cases for improving error messages

Shriramana Sharma via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Oct 25 04:44:31 PDT 2014


Hello. Please see the following and say whether they're OK to submit
as bugs for improving the error messages. Thanks.

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: add ", return values" after "parameters"
}


-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा



More information about the Digitalmars-d-learn mailing list