[Issue 13656] New: clarify error message upon trying to declare a variable of type ref
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Oct 25 09:15:01 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13656
Issue ID: 13656
Summary: clarify error message upon trying to declare a
variable of type ref
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:
void main () {
int i ;
ref ir = i ;
}
produces the following error message:
"variable ref_type.main.ir only parameters or foreach declarations can be ref"
The sentence is unclear "variable x only ... can be ref". What is meant is
"Attempt to declare variable of type ref". Please clarify this.
Also, please add ", return values" after "parameters" in the above error
message since code like:
ref int foo(ref int x) { return x ; }
is permitted.
--
More information about the Digitalmars-d-bugs
mailing list