TS8099
Front-end code UNSUPPORTED
The catch-all for a diagnostic whose site does not yet deserve its own code. It stays parked at TS8099, past the sequential range.
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 { let g = 0. do { g += 0.5 } while (g < 1.) return vec4(g, g, g, 1.)}Compiled at build time against the pinned compiler, this program gets:
TS8099 error, line 6: do…while is not supported: the IR has one loop shape, a top-tested "for", and a do…while runs its body before the first test. Write "while (c) { … }" with the body's first pass unrolled above it, or a counted "for".
How to fix it
The same program, corrected. It compiles with no diagnostic.
"use typeshade"
@fragmentexport function main(uv: location<0, vec2>): vec4 { let g = 0.5 while (g < 1.) { g += 0.5 } return vec4(g, g, g, 1.)}The rules 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>. - Rule 6.2 Test
- A storage binding’s access mode is inferred from what the program does: a binding that some entry writes, by assignment, a mutating method, an atomic builtin, or a write through a function or a reference parameter, is
var<storage, read_write>, and every other storage binding isvar<storage, read>. - Rule 6.10 Test
- A local
constbinds its name once and leaves what it holds as writable as TypeScript does. - Rule 7.7 Test
discardmust be written as a bare statement, the identifier alone (discard), and may stand in a fragment entry and in a helper no vertex or compute entry can reach.- Rule 7.10 Test
T | undefinedandT | nullare optional values.- Rule 8.3 Test
- A builtin WGSL confines by stage may be used in an entry of a permitted stage, and in a helper that no entry of an excluded stage can reach.
- Rule 8.6 Test
- An entry point must not be called from another function, and neither may a kernel function (Rule 8.22).
- Rule 8.17 Test
- A local function (a
constthat holds an arrow function or a function expression, or afunctiondeclaration, written inside a function’s body) is a function of the module named after the body that declares it (surface §14), and it may read and write the variables of the functions around it, as a TypeScript closure does. - Rule 8.18 Test
- A function whose parameter has a function type, written out (
f: (x: f32) => f32) or through a type alias of one, takes a function: a function declared at the top of the file or of a namespace, a method, a static method, a constructor, a field that holds a function (Rule 8.16) and a local function (Rule 8.17). - Rule 8.23 Test
- A kernel function’s parameter of an array with no size is the caller’s array (change 0142): the body reads its elements and its
.length, writes its elements in place, and cannot assign it whole (TS8018).
See also
-
SD0109 - a fragment-only builtin is reachable from a vertex or compute entry
Source
Where the compiler raises this code at commit af54ddad5, one line per file:
-
src/compiler/ts/bindings.ts:134(2 sites) -
src/compiler/ts/diagnostic.ts:145 -
src/compiler/ts/lower/array-constructor/form.ts:92(3 sites) -
src/compiler/ts/lower/array-constructor/from.ts:117 -
src/compiler/ts/lower/array-constructor/lower.ts:98(2 sites) -
src/compiler/ts/lower/array-constructor/lowering.ts:32(2 sites) -
src/compiler/ts/lower/array-methods.ts:112(6 sites) -
src/compiler/ts/lower/array-methods/named-function.ts:57 -
src/compiler/ts/lower/array-methods/value-methods.ts:68(4 sites) -
src/compiler/ts/lower/array-methods/value-refusals.ts:23(2 sites) -
src/compiler/ts/lower/atomics.ts:51 -
src/compiler/ts/lower/collections.ts:39 -
src/compiler/ts/lower/control.ts:58 -
src/compiler/ts/lower/control/for-of.ts:163(2 sites) -
src/compiler/ts/lower/control/for-update.ts:43 -
src/compiler/ts/lower/expression-array.ts:40(4 sites) -
src/compiler/ts/lower/expression-call.ts:185(7 sites) -
src/compiler/ts/lower/expression-call/gather.ts:43 -
src/compiler/ts/lower/expression-call/select-and-reduce.ts:60(2 sites) -
src/compiler/ts/lower/expression-call/storage-depth.ts:210 -
src/compiler/ts/lower/expression-call/texture-call.ts:151(2 sites) -
src/compiler/ts/lower/expression-misc.ts:56(2 sites) -
src/compiler/ts/lower/expression-prop.ts:110(2 sites) -
src/compiler/ts/lower/expression-prop/object-literal.ts:44(5 sites) -
src/compiler/ts/lower/expression.ts:249(10 sites) -
src/compiler/ts/lower/expression/identifier.ts:62(2 sites) -
src/compiler/ts/lower/function-args.ts:140(2 sites) -
src/compiler/ts/lower/function.ts:1471(4 sites) -
src/compiler/ts/lower/made-array/candidate.ts:111(2 sites) -
src/compiler/ts/lower/made-array/identity.ts:19 -
src/compiler/ts/lower/made-array/lower.ts:37 -
src/compiler/ts/lower/made-array/nest.ts:116 -
src/compiler/ts/lower/made-array/settle.ts:88(2 sites) -
src/compiler/ts/lower/optional-values.ts:257 -
src/compiler/ts/lower/optional-values/operands.ts:36 -
src/compiler/ts/lower/runtime-array.ts:70 -
src/compiler/ts/lower/second-name.ts:64(3 sites) -
src/compiler/ts/lower/statement.ts:312(3 sites) -
src/compiler/ts/lower/statement/binding-pattern.ts:41(6 sites) -
src/compiler/ts/lower/statement/declaration-forms.ts:32(2 sites) -
src/compiler/ts/lower/statement/declaration-kind.ts:77(4 sites) -
src/compiler/ts/lower/statement/expression-statement.ts:102(4 sites) -
src/compiler/ts/math-binding.ts:95(8 sites) -
src/compiler/ts/mixins.ts:18 -
src/compiler/ts/module-vars.ts:352 -
src/compiler/ts/module.ts:93 -
src/compiler/ts/stage-restrictions.ts:229 -
src/compiler/ts/storage-access.ts:155(3 sites) -
src/compiler/ts/structs/with-shapes.ts:27 -
src/core/coverage/glsl/statements-and-preprocessor.ts:59 -
src/language-service/check.ts:114 -
src/language-service/diagnostics/readonly-write.ts:63 -
src/language-service/diagnostics/refused-uses.ts:246