TS8073
Front-end code REFERENCE
A reference parameter written or passed where this version does not take one (Rule 8.25, surface §70, proposal 0040): a Ref<T> parameter handed a value rather than ref(x); ref(...) handed something that is not a place a function may write (a value parameter, a const that may share its value, a read-only binding, a literal, a temporary, a component of a vector); ref(...) anywhere but as the argument of a Ref<T> parameter, and handed to a parameter that takes a value; Ref<T> anywhere but as a parameter of a function declared at the top of the file or of a namespace (a return, a field, a local, a method's, a local function's, an entry's, a generic function's); and a local function that captures a Ref<T> parameter.
No example is written for this code at this commit yet.
The registry text and every compiler message on these pages are the compiler's own English.
When it fires
A reference parameter written or passed where this version does not take one (Rule 8.25, surface §70, proposal 0040): a Ref<T> parameter handed a value rather than ref(x); ref(...) handed something that is not a place a function may write (a value parameter, a const that may share its value, a read-only binding, a literal, a temporary, a component of a vector); ref(...) anywhere but as the argument of a Ref<T> parameter, and handed to a parameter that takes a value; Ref<T> anywhere but as a parameter of a function declared at the top of the file or of a namespace (a return, a field, a local, a method's, a local function's, an entry's, a generic function's); and a local function that captures a Ref<T> parameter. Each names the edit.
The rule this enforces
- Rule 8.25 Test
- A parameter declared
Ref<T>names the caller’s place, and the call passes it asref(place): reading the parameter reads that place, and assigning to it, or to a field, component or element of it, writes it, for the call.
See also
Source
Where the compiler raises this code at commit c66579bf, one line per file: