TS8013
이 페이지에서

TS8013

프런트엔드 코드 HOST_STMT

Host control flow and the JavaScript runtime forms no shader has: await, yield, an async or generator function, try/catch/throw, for…in, var, a spread outside an object literal, and a template string.

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

발생 조건

Host control flow and the JavaScript runtime forms no shader has: await, yield, an async or generator function, try/catch/throw, for…in, var, a spread outside an object literal, and a template string. A new is a class rule, CLASS_MEMBER.

예제

example.shade.ts
"use typeshade"
@fragment
export function main(@location(0) uv: vec2): vec4 {
try {
return vec4(uv, 0., 1.)
} catch (e) {
return vec4(0., 0., 0., 1.)
}
}

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

TS8013 error, 5행: try/catch/throw are JS exceptions. TypeShade has no exception path.

고치는 법

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

example.shade.ts
"use typeshade"
@fragment
export function main(@location(0) uv: vec2): vec4 {
return vec4(uv, 0., 1.)
}

함께 보기

TS8035 CLASS_MEMBER
A class member shape the surface does not take, or a use of a member the class rules refuse, and a new that builds no class (Rule 8.13).

소스

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

이 페이지 편집 문제 보고