---
title: "TS8019 ARITY_MISMATCH: a TypeShade compiler error code"
description: "TS8019 ARITY_MISMATCH, an error code of the TypeShade compiler. A wrong number of arguments, elements or fields at a call or a constructor."
url: https://typeshade.dev/reference/errors/ts8019/
language: en
---

# `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

```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

```ts
"use typeshade"

@fragment
export function main(uv: location<0, vec2>): vec4 {
  return vec4(uv, 0., 1.)
}
```

## The rules this enforces

**[Rule 2.2](https://typeshade.dev/reference/rules/2-2/) Test**

A compiler-internal name (§2.1) must not be authorable.

**[Rule 7.10](https://typeshade.dev/reference/rules/7-10/) Test**

`T | undefined` and `T | null` are optional values.

**[Rule 8.18](https://typeshade.dev/reference/rules/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](https://typeshade.dev/reference/rules/8-16/)) and a local function ([Rule 8.17](https://typeshade.dev/reference/rules/8-17/)).

**[Rule 9.2](https://typeshade.dev/reference/rules/9-2/) Test**

A builtin’s signature must be WGSL’s, checked at the call.

**[Rule 9.9](https://typeshade.dev/reference/rules/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](https://typeshade.dev/reference/rules/1-4/)).

## See also

- [Functions](https://typeshade.dev/guide/language/functions/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

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

- [`src/compiler/ts/generic-structs.ts:84`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/generic-structs.ts#L84) (2 sites)
- [`src/compiler/ts/internal-ops.ts:62`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/internal-ops.ts#L62)
- [`src/compiler/ts/lower/array-constructor/lower.ts:80`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/array-constructor/lower.ts#L80)
- [`src/compiler/ts/lower/array-methods.ts:80`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/array-methods.ts#L80) (4 sites)
- [`src/compiler/ts/lower/array-methods/value-methods.ts:53`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/array-methods/value-methods.ts#L53)
- [`src/compiler/ts/lower/atomics.ts:94`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/atomics.ts#L94) (2 sites)
- [`src/compiler/ts/lower/barriers.ts:35`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/barriers.ts#L35) (2 sites)
- [`src/compiler/ts/lower/class-methods/construct.ts:250`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/class-methods/construct.ts#L250)
- [`src/compiler/ts/lower/expression-array.ts:52`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-array.ts#L52) (3 sites)
- [`src/compiler/ts/lower/expression-array/fold.ts:51`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-array/fold.ts#L51) (2 sites)
- [`src/compiler/ts/lower/expression-call.ts:450`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call.ts#L450) (7 sites)
- [`src/compiler/ts/lower/expression-call/args.ts:186`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call/args.ts#L186) (2 sites)
- [`src/compiler/ts/lower/expression-call/bit-builtins.ts:161`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call/bit-builtins.ts#L161)
- [`src/compiler/ts/lower/expression-call/matrix-ctor.ts:140`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call/matrix-ctor.ts#L140)
- [`src/compiler/ts/lower/expression-call/select-and-reduce.ts:27`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call/select-and-reduce.ts#L27) (2 sites)
- [`src/compiler/ts/lower/expression-call/storage-depth.ts:33`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call/storage-depth.ts#L33)
- [`src/compiler/ts/lower/expression-misc.ts:143`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-misc.ts#L143)
- [`src/compiler/ts/lower/expression-misc/scalar-calls.ts:54`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-misc/scalar-calls.ts#L54) (2 sites)
- [`src/compiler/ts/lower/function-args.ts:112`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function-args.ts#L112) (2 sites)
- [`src/compiler/ts/lower/function/type-arguments.ts:57`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function/type-arguments.ts#L57)
- [`src/compiler/ts/lower/statement/binding-pattern.ts:133`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/statement/binding-pattern.ts#L133)
- [`src/compiler/ts/lower/subgroups.ts:69`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/subgroups.ts#L69)
