TS8019
On this page

TS8019

Front-end code ARITY_MISMATCH

A wrong number of arguments, elements or fields at a call or a constructor.

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

example.shade.ts
"use typeshade"
@fragment
export function main(uv: location<0, 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.

example.shade.ts
"use typeshade"
@fragment
export function main(uv: location<0, 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 7.10 Test
T | undefined and T | null are optional values.
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.
Rule 9.9 Test
A WGSL built-in function, an overload of one, or a §9.3 name must not be authorable when an ECMAScript spelling the compiler supports carries every case it accepts with the same meaning (Rule 1.4).

See also

Source

Where the compiler raises this code at commit af54ddad5, one line per file:

Edit this page Report a problem