---
title: "TS8023 DUPLICATE_SYMBOL: TypeShade 컴파일러가 진단에 붙이는 오류 코드 한 가지"
description: "TS8023 DUPLICATE_SYMBOL, TypeShade 컴파일러의 오류 코드입니다. 한 범위에서 같은 함수, 바인딩, 모듈 상수, 구조체 이름을 두 번 선언합니다. 구조체는 어떤 표기로 선언했든 셉니다."
url: https://typeshade.dev/ko/reference/errors/ts8023/
language: ko
---

# `TS8023`

프런트엔드 코드 `DUPLICATE_SYMBOL`

한 범위에서 같은 함수, 바인딩, 모듈 상수, 구조체 이름을 두 번 선언합니다. 구조체는 어떤 표기로 선언했든 셉니다. 클래스, 인터페이스, 타입 별칭이 같은 이름이면 구조체 하나이므로 두 번째 선언은 중복입니다.

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

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

## 예제

example.shade.ts

```ts
"use typeshade"

function shade(x: f32): f32 {
  return x * 0.5
}

function shade(x: f32): f32 {
  return x * 0.25
}

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

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

**TS8023** error, 7행: Duplicate function "shade".

## 고치는 법

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

example.shade.ts

```ts
"use typeshade"

function shade(x: f32): f32 {
  return x * 0.5
}

function shadeQuarter(x: f32): f32 {
  return x * 0.25
}

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

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

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

A type alias is another name for its target.

## 함께 보기

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

## 소스

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

- [`src/compiler/ts/bindings.ts:115`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/bindings.ts#L115)
- [`src/compiler/ts/link.ts:814`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/link.ts#L814)
- [`src/compiler/ts/lower/control/for-of.ts:128`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/control/for-of.ts#L128)
- [`src/compiler/ts/lower/function.ts:357`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function.ts#L357) (4곳)
- [`src/compiler/ts/lower/second-name.ts:153`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/second-name.ts#L153)
- [`src/compiler/ts/lower/statement/declaration-kind.ts:94`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/statement/declaration-kind.ts#L94) (2곳)
- [`src/compiler/ts/lower/statement/define-local.ts:47`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/statement/define-local.ts#L47)
- [`src/compiler/ts/module-const.ts:204`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/module-const.ts#L204) (2곳)
- [`src/compiler/ts/module-vars.ts:215`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/module-vars.ts#L215) (2곳)
- [`src/compiler/ts/source-file.ts:825`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/source-file.ts#L825)
- [`src/compiler/ts/structs/add-struct.ts:73`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/structs/add-struct.ts#L73)
- [`src/compiler/ts/structs/candidates.ts:67`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/structs/candidates.ts#L67)
