October 25, 2014 [Issue 13656] New: clarify error message upon trying to declare a variable of type ref | ||||
---|---|---|---|---|
| ||||
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@puremagic.com Reporter: samjnaa@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. -- |
Copyright © 1999-2021 by the D Language Foundation