---
title: "TS8036 MATH_ARGUMENT: TypeShade 컴파일러가 진단에 붙이는 오류 코드 한 가지"
description: "TS8036 MATH_ARGUMENT, TypeShade 컴파일러의 오류 코드입니다. 시그니처가 받지 않는 인자로 수학 내장 함수를 부릅니다."
url: https://typeshade.dev/ko/reference/errors/ts8036/
language: ko
---

# `TS8036`

프런트엔드 코드 `MATH_ARGUMENT`

시그니처가 받지 않는 인자로 수학 내장 함수를 부릅니다. 모양이 맞아야 하는 두 값(`dot(vec3, vec2)`), 내장 함수에 해당 형태가 없는 요소 종류(정수 벡터의 `sin`), 벡터가 와야 할 곳의 스칼라(`normalize(s)`), 타입이 잘못된 계수, 지수, 오프셋, 개수가 그렇습니다. 메시지는 문제의 인자와, 짧게 고칠 수 있으면 방법을 알려 줍니다. 스칼라를 펼치거나, 한쪽을 변환하거나, 벡터 크기를 맞춥니다.

레지스트리에는 이 상수에 대한 문서 주석이 없습니다. 그래서 위 설명은 컴파일러가 이 코드와 함께 내는 메시지를 보고 이 사이트가 쓴 것입니다.

레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.

## 예제

example.shade.ts

```ts
"use typeshade"

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

빌드할 때 고정된 컴파일러로 이 프로그램을 컴파일하면 다음 진단이 나옵니다.

**TS8036** error, 6행: dot takes arguments of one type; the first is `vec3`, this one `vec2`. Give the vectors one size.

## 고치는 법

같은 프로그램을 고친 모습입니다. 진단 없이 컴파일됩니다.

example.shade.ts

```ts
"use typeshade"

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

## 이 코드가 적용하는 규칙

**[규칙 9.2](https://typeshade.dev/ko/reference/rules/9-2/) 테스트**

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

**[규칙 12.6](https://typeshade.dev/ko/reference/rules/12-6/) 테스트**

A requirement the front end can check must be checked at the front end, in the author’s words, and not left to Tint or a driver.

## 함께 보기

- [함수](https://typeshade.dev/ko/guide/language/functions/)
- [오류 코드](https://typeshade.dev/ko/reference/errors/)

## 소스

커밋 af54ddad5에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.

- [`src/compiler/ts/abstract-const.ts:1084`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/abstract-const.ts#L1084) (2곳)
- [`src/compiler/ts/lower/math-args.ts:263`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/math-args.ts#L263)
- [`src/compiler/ts/remedies/validate.ts:75`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/remedies/validate.ts#L75) (2곳)
