ScalarCastSource
Type in Types
The scalar keys a cast reads: every native scalar, plus the emulated double.
import type { ScalarCastSource } from 'typeshade'import type { ScalarCastSource } from 'typeshade/core/ir'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
type ScalarCastSource = 'f32' | 'i32' | 'u32' | 'f64' | 'bool';Description
WGSL converts
between all of them — f32(true) is 1.0 — and none of them is a vector, which is the
point: f32(someVec3) used to type-check on both authoring surfaces and emit f32(v),
which no target compiles.
Source
src/core/ir/node.ts, line 730, at commit af54ddad5