TS8019
프런트엔드 코드 ARITY_MISMATCH
Wrong number of arguments, elements, or fields at a call or constructor site.
레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.
예제
"use typeshade"
@fragmentexport function main(@location(0) uv: vec2): vec4 { return vec4(uv, 0.)}빌드할 때 고정된 컴파일러로 이 프로그램을 컴파일하면 다음 진단이 나옵니다.
TS8019 error, 5행: Vector constructor component count mismatch.
고치는 법
같은 프로그램을 고친 모습입니다. 진단 없이 컴파일됩니다.
"use typeshade"
@fragmentexport function main(@location(0) uv: vec2): vec4 { return vec4(uv, 0., 1.)}이 코드가 적용하는 규칙
- 규칙 2.2 테스트
- A compiler-internal name (§2.1) must not be authorable.
- 규칙 8.18 테스트
- 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). - 규칙 9.2 테스트
- A builtin’s signature must be WGSL’s, checked at the call.
함께 보기
소스
커밋 c66579bf에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.
-
src/compiler/ts/generic-structs.ts:124(2곳) -
src/compiler/ts/lower/array-methods.ts:171(4곳) -
src/compiler/ts/lower/atomics.ts:119(2곳) -
src/compiler/ts/lower/barriers.ts:61(2곳) -
src/compiler/ts/lower/class-methods.ts:1821 -
src/compiler/ts/lower/expression-array.ts:64(6곳) -
src/compiler/ts/lower/expression-call.ts:604(13곳) -
src/compiler/ts/lower/expression-misc.ts:61(3곳) -
src/compiler/ts/lower/function-args.ts:102(2곳) -
src/compiler/ts/lower/function.ts:3575