TS8019
Front-end code ARITY_MISMATCH
Wrong number of arguments, elements, or fields at a call or constructor site.
The registry text and every compiler message on these pages are the compiler's own English.
Example
"use typeshade"
@fragmentexport function main(@location(0) uv: vec2): vec4 { return vec4(uv, 0.)}Compiled at build time against the pinned compiler, this program gets:
TS8019 error, line 5: Vector constructor component count mismatch.
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.)}The rules this enforces
- Rule 2.2 Test
- A compiler-internal name (§2.1) must not be authorable.
- 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 9.2 Test
- A builtin’s signature must be WGSL’s, checked at the call.
See also
Source
Where the compiler raises this code at commit 26de7be8, one line per file:
-
src/compiler/ts/generic-structs.ts:124(2 sites) -
src/compiler/ts/lower/array-methods.ts:171(4 sites) -
src/compiler/ts/lower/atomics.ts:119(2 sites) -
src/compiler/ts/lower/barriers.ts:61(2 sites) -
src/compiler/ts/lower/class-methods.ts:1807 -
src/compiler/ts/lower/expression-array.ts:64(6 sites) -
src/compiler/ts/lower/expression-call.ts:597(13 sites) -
src/compiler/ts/lower/expression-misc.ts:60(3 sites) -
src/compiler/ts/lower/function-args.ts:102(2 sites) -
src/compiler/ts/lower/function.ts:3446