---
title: "TS8028 ATTRIBUTE_NAME: TypeShade 컴파일러가 진단에 붙이는 오류 코드 한 가지"
description: "TS8028 ATTRIBUTE_NAME, TypeShade 컴파일러의 오류 코드입니다. 이 표면이 읽지 않는 데코레이터나 진입점 형태입니다."
url: https://typeshade.dev/ko/reference/errors/ts8028/
language: ko
---

# `TS8028`

프런트엔드 코드 `ATTRIBUTE_NAME`

이 표면이 읽지 않는 데코레이터나 진입점 형태입니다. 속성 어휘(`@vertex`, `@fragment`, `@compute`, `@builtin`, `@location`) 밖의 식별자(`@vertx` 같은 오타), 표면이 다른 방식으로 쓰거나 빌려 오지 않는 WGSL 속성(직접 쓴 `@diagnostic(…)` 같은 것), `vertex(f)`처럼 호출로 쓴 스테이지, `export default`처럼 [규칙 8.1](https://typeshade.dev/ko/reference/rules/8-1/)이 거부하는 형태로 쓴 진입점, 데코레이터를 받지 않는 선언이나 자리에 붙은 데코레이터가 그렇습니다([규칙 6.7](https://typeshade.dev/ko/reference/rules/6-7/)). 이 코드가 없으면 데코레이터를 붙인 함수나 필드가 아무 말 없이 진입점이나 IO 필드가 아니게 됩니다.

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

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

## 예제

example.shade.ts

```ts
"use typeshade"

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

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

**TS8028** error, 3행: a stage is an attribute on the function declaration: write "`@fragment` export function main(…)", or run "tshc migrate" (change 0130)

## 고치는 법

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

example.shade.ts

```ts
"use typeshade"

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

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

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

Where ECMAScript has a form that carries the GPU meaning, the surface must borrow TypeScript’s spelling; a WGSL spelling is borrowed only where no ECMAScript spelling carries the meaning, and the borrowing must keep every WGSL capability reachable ([Rule 11.14](https://typeshade.dev/ko/reference/rules/11-14/)).

**[규칙 1.8](https://typeshade.dev/ko/reference/rules/1-8/) 테스트**

A construct of the language is written in the language’s own syntax: the directive, a type of the surface, or an attribute `@name` or `@name(…)` on the declaration it marks.

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

An entry point’s inputs and outputs are explicit parameters and return values.

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

The attribute names the compiler reads are `vertex`, `fragment`, `compute`, `workgroup_size`, `builtin`, `location`, `interpolate`, `invariant` and `blend_src` (the last three since [#168](https://github.com/typeshade/typeshade/issues/168), surface §53).

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

The byte layout the emitted module assumes for a resource and the layout `reflect()` reports must agree byte for byte, under WGSL’s uniform and storage layout rules, and so must the layout the manifest carries ([Rule 11.10](https://typeshade.dev/ko/reference/rules/11-10/)); a vertex entry’s vertex buffer is one layout, its `@location` inputs tightly packed in the order written and numbered in that order where no `location<n, T>` states the number ([Rule 6.6](https://typeshade.dev/ko/reference/rules/6-6/)), which `reflect().vertex` and the manifest both report.

**[규칙 8.1](https://typeshade.dev/ko/reference/rules/8-1/) 테스트**

An entry point is a function declaration at the top of the file or of a namespace, exported or not, with exactly one stage attribute written before the declaration: `@vertex export function vs(…)`, `@fragment …`, or `@compute([x, y?, z?]) …`.

**[규칙 8.5](https://typeshade.dev/ko/reference/rules/8-5/) 테스트**

A collective operation (a derivative, an implicit-LOD texture sample, a barrier) must be in uniform control flow.

**[규칙 8.22](https://typeshade.dev/ko/reference/rules/8-22/) 테스트**

A kernel function is an exported function that is not an entry point, a function declaration, and takes at least one array with no size (`array<T>`) or one 2D storage texture (`texture_storage_2d<F, A>`, change 0077), or returns an array with no size that its body makes ([Rule 8.23](https://typeshade.dev/ko/reference/rules/8-23/), change 0114, S5); a sampled texture alone does not make one, so an exported helper that reads one stays a helper an entry calls; its candidate loops are the `for` and `for…of` statements at the top level of its body, and no other loop is ever a candidate.

**[규칙 8.25](https://typeshade.dev/ko/reference/rules/8-25/) 테스트**

An object parameter that its function writes is the caller’s object, and the call passes the variable itself, unmarked: reading the parameter reads that object, and assigning to a field or an element of it writes it, for the call (change 0142).

## 함께 보기

- [셰이더 스테이지](https://typeshade.dev/ko/guide/language/stages/)
- [오류 코드](https://typeshade.dev/ko/reference/errors/)

## 소스

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

- [`src/compiler/ts/builtin-check.ts:63`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/builtin-check.ts#L63) (5곳)
- [`src/compiler/ts/builtin-check/unread-site.ts:102`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/builtin-check/unread-site.ts#L102)
- [`src/compiler/ts/builtin-type-form.ts:80`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/builtin-type-form.ts#L80)
- [`src/compiler/ts/decorated-form.ts:150`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/decorated-form.ts#L150) (2곳)
- [`src/compiler/ts/lower/expression-call.ts:532`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call.ts#L532)
- [`src/compiler/ts/lower/function-signature/parameters.ts:289`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function-signature/parameters.ts#L289)
- [`src/compiler/ts/lower/function-signature/stage.ts:147`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function-signature/stage.ts#L147) (2곳)
- [`src/compiler/ts/lower/function-signature/workgroup.ts:116`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function-signature/workgroup.ts#L116) (2곳)
- [`src/compiler/ts/lower/return-location.ts:41`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/return-location.ts#L41) (2곳)
- [`src/compiler/ts/stage-call.ts:229`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/stage-call.ts#L229)
- [`src/core/coverage/wgsl/attributes.ts:158`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/coverage/wgsl/attributes.ts#L158)
- [`src/language-service/diagnostics/refusal-tables.ts:9`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/language-service/diagnostics/refusal-tables.ts#L9)
- [`src/language-service/diagnostics/refused-attributes.ts:22`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/language-service/diagnostics/refused-attributes.ts#L22) (3곳)
