TS8013
Front-end code HOST_STMT
Host control flow and the JavaScript runtime forms 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.
The registry text and every compiler message on these pages are the compiler's own English.
When it fires
Host control flow and the JavaScript runtime forms 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.
Example
"use typeshade"
@fragmentexport function main(@location(0) uv: 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(@location(0) uv: vec2): vec4 { return vec4(uv, 0., 1.)}See also
Source
Where the compiler raises this code at commit 26de7be8, one line per file: