SD0008
On this page

SD0008

Core code

swizzle on a non-vector

The registry text and every compiler message on these pages are the compiler's own English.

In the front end

A "use typeshade" file never reaches this check with the same mistake: the front end refuses it first, under its own code. This program, compiled at build time, gets:

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

TS8022 error, line 6: .xy on f32 — swizzle requires vec2/vec3/vec4.

See also

TS8022 UNKNOWN_NAME
Reference to a name TypeShade cannot resolve (identifier, struct field, or struct shape) that is not a function call (UNKNOWN_FN) or a type name (UNKNOWN_TYPE), in a body a call lowers or in one no call lowers; a name the library declares for TypeScript's own use (Object, Math, Symbol), or the file declares as an enum, a namespace, a class or a type, read as a value says what it is.

Source

Where the compiler raises this code at commit 26de7be8, one line per file:

Edit this page Report a problem