TS8079
Front-end code HOST_RESERVED_FIELD
A field of the class of an exported binding that is named like a member of its host accessor (Rule 6.1): set on the class of an exported uniform<T> or of the element of an exported storage array, and needsUpdate or dispose on the class of an exported uniform<T>. The host sets a field through its accessor (camera.pos.set(…)), so a field of the accessor's own name cannot be reached.
The registry has no documentation comment for this constant, so the line above is written by this site from the messages the compiler raises it with.
The registry text and every compiler message on these pages are the compiler's own English.
Example
"use typeshade"
export class Light { color: vec3 = vec3(1.) set: f32 = 1.}
export declare const light: uniform<Light>
@fragmentexport function main(): vec4 { return vec4(light.color * light.set, 1.)}Compiled at build time against the pinned compiler, this program gets:
TS8079 error, line 5: "Light.set" is named like the host accessor's own method "set": "light" is a binding the module exports, a Uniform<Light> in the host, whose fields are properties of that accessor. Rename the field (Rule 6.1).
How to fix it
The same program, corrected. It compiles with no diagnostic.
"use typeshade"
export class Light { color: vec3 = vec3(1.) strength: f32 = 1.}
export declare const light: uniform<Light>
@fragmentexport function main(): vec4 { return vec4(light.color * light.strength, 1.)}The rule this enforces
- Rule 6.1 Test
- A resource must be written
declare const x: uniform<T>,declare const x: storage<T>,declare const x: storage<T, "read_write">, ordeclare const x: <texture or sampler type>.
See also
Source
Where the compiler raises this code at commit af54ddad5, one line per file: