TS8013
Front-end code HOST_STMT
Host control flow and JavaScript runtime forms that no shader has: await, yield, an async or generator function, try/catch/throw, for…in, var, a spread outside an object literal and a template string. A new is a class rule, CLASS_MEMBER.
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"
@fragmentexport function main(uv: location<0, vec2>): vec4 { try { return vec4(uv, 0., 1.) } catch (e) { return vec4(0., 0., 0., 1.) }}Compiled at build time against the pinned compiler, this program gets:
TS8013 error, line 5: try/catch/throw are JS exceptions. TypeShade has no exception path.
How to fix it
The same program, corrected. It compiles with no diagnostic.
"use typeshade"
@fragmentexport function main(uv: location<0, vec2>): vec4 { return vec4(uv, 0., 1.)}See also
Source
Where the compiler raises this code at commit af54ddad5, one line per file: