SD0017
코어 코드
literal cannot be spelled by the target
레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.
프런트엔드에서
같은 실수를 한 "use typeshade" 파일은 이 검사까지 오지 않습니다. 프런트엔드가 자기 코드로 먼저 거부하기 때문입니다. 빌드할 때 컴파일한 아래 프로그램에는 다음 진단이 나옵니다.
"use typeshade"
@fragmentexport function main(uv: location<0, vec2>): vec4 { const k: i32 = 3000000000 return vec4(uv, f32(k), 1.)} TS8003 error, 5행: The value has to fit: 3000000000 is outside i32, which holds -2147483648 to 2147483647 (§13).
고치는 법
레지스트리의 힌트: an i32/u32 literal must be an integer inside its 32-bit range and a float literal must be finite — neither WGSL nor GLSL has a NaN/Infinity spelling, and an out-of-range integer literal is a driver compile error; clamp or wrap the host-side value before it becomes a literal
함께 보기
소스
커밋 af54ddad5에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.