---
title: "SD0010: TypeShade 컴파일러가 진단에 붙이는 오류 코드와 그 뜻, 고치는 법"
description: "SD0010, TypeShade 컴파일러의 오류 코드입니다. select branches have differing types"
url: https://typeshade.dev/ko/reference/errors/sd0010/
language: ko
---

# `SD0010`

코어 코드

select branches have differing types

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

## 프런트엔드에서

같은 실수를 한 `"use typeshade"` 파일은 이 검사까지 오지 않습니다. 프런트엔드가 자기 코드로 먼저 거부하기 때문입니다. 빌드할 때 컴파일한 아래 프로그램에는 다음 진단이 나옵니다.

example.shade.ts

```ts
"use typeshade"

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

**[TS8003](https://typeshade.dev/ko/reference/errors/ts8003/)** error, 5행: Ternary arm type mismatch: `vec2` vs `f32`.

## 고치는 법

레지스트리의 힌트: both branches of a select/ifExpr must share a type

## 함께 보기

**[`TS8003`](https://typeshade.dev/ko/reference/errors/ts8003/) `TYPE_MISMATCH`**

연산자나 조건, 선언, 반환, 인자처럼 두 값이 만나는 자리에서 타입이 서로 맞지 않거나, 검사로 좁히지 않은 선택적 값(`T | undefined`, `T | null`, `T | null | undefined`)을 읽거나([규칙 7.10](https://typeshade.dev/ko/reference/rules/7-10/)), 컴파일러가 접는 상수를 WGSL이 거부합니다. 31을 넘는 시프트 양, 0인 제수, 서로 엇갈린 clamp 경계, 범위를 넘는 `f32` 값, `Math.pow(-2., 2.)`처럼 정의역 밖에서 부르는 내장 함수가 그렇습니다.

- [타입](https://typeshade.dev/ko/guide/language/types/)
- [`TypeShadeError`](https://typeshade.dev/ko/api/typeshadeerror/)
- [오류 코드](https://typeshade.dev/ko/reference/errors/)

## 소스

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

- [`src/core/ir/node.ts:641`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L641)
