TS8074
Front-end code REFERENCE_ALIAS
Two references to one place in one call (Rule 8.25, surface §70, proposal 0040): two arguments a callee takes by reference whose places share a root (swap(ref(x), ref(x)), swap(ref(o.a), ref(o.b))), a method's object or a variable a local function writes beside a ref(...) of the same root, and a ref(...) of a module variable or binding that the callee also reads or writes directly.
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
Two references to one place in one call (Rule 8.25, surface §70, proposal 0040): two arguments a callee takes by reference whose places share a root (swap(ref(x), ref(x)), swap(ref(o.a), ref(o.b))), a method's object or a variable a local function writes beside a ref(...) of the same root, and a ref(...) of a module variable or binding that the callee also reads or writes directly. WGSL's alias analysis refuses the same programs; GLSL ES 3.00's copy-in and copy-out and the CPU's store-back would disagree on them.
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: