TS8019
프런트엔드 코드 ARITY_MISMATCH
호출이나 생성자에서 인자, 요소, 필드의 개수가 맞지 않습니다.
레지스트리에는 이 상수에 대한 문서 주석이 없습니다. 그래서 위 설명은 컴파일러가 이 코드와 함께 내는 메시지를 보고 이 사이트가 쓴 것입니다.
레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.
예제
"use typeshade"
@fragmentexport function main(uv: location<0, vec2>): vec4 { return vec4(uv, 0.)}빌드할 때 고정된 컴파일러로 이 프로그램을 컴파일하면 다음 진단이 나옵니다.
TS8019 error, 5행: Vector constructor component count mismatch.
고치는 법
같은 프로그램을 고친 모습입니다. 진단 없이 컴파일됩니다.
"use typeshade"
@fragmentexport function main(uv: location<0, vec2>): vec4 { return vec4(uv, 0., 1.)}이 코드가 적용하는 규칙
- 규칙 2.2 테스트
- A compiler-internal name (§2.1) must not be authorable.
- 규칙 7.10 테스트
T | undefinedandT | nullare optional values.- 규칙 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.
- 규칙 9.9 테스트
- 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).
함께 보기
소스
커밋 af54ddad5에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.
-
src/compiler/ts/generic-structs.ts:84(2곳) -
src/compiler/ts/internal-ops.ts:62 -
src/compiler/ts/lower/array-constructor/lower.ts:80 -
src/compiler/ts/lower/array-methods.ts:80(4곳) -
src/compiler/ts/lower/array-methods/value-methods.ts:53 -
src/compiler/ts/lower/atomics.ts:94(2곳) -
src/compiler/ts/lower/barriers.ts:35(2곳) -
src/compiler/ts/lower/class-methods/construct.ts:250 -
src/compiler/ts/lower/expression-array.ts:52(3곳) -
src/compiler/ts/lower/expression-array/fold.ts:51(2곳) -
src/compiler/ts/lower/expression-call.ts:450(7곳) -
src/compiler/ts/lower/expression-call/args.ts:186(2곳) -
src/compiler/ts/lower/expression-call/bit-builtins.ts:161 -
src/compiler/ts/lower/expression-call/matrix-ctor.ts:140 -
src/compiler/ts/lower/expression-call/select-and-reduce.ts:27(2곳) -
src/compiler/ts/lower/expression-call/storage-depth.ts:33 -
src/compiler/ts/lower/expression-misc.ts:143 -
src/compiler/ts/lower/expression-misc/scalar-calls.ts:54(2곳) -
src/compiler/ts/lower/function-args.ts:112(2곳) -
src/compiler/ts/lower/function/type-arguments.ts:57 -
src/compiler/ts/lower/statement/binding-pattern.ts:133 -
src/compiler/ts/lower/subgroups.ts:69