SD0003
Core code
arithmetic op on a bool operand
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:
"use typeshade"
@fragmentexport function main(uv: location<0, vec2>): vec4 { const b = uv.x > 0.5 return vec4(uv, b + 1., 1.)} TS8003 error, line 6: Type mismatch: cannot + bool and f32. Types must match, or cast with f32()/i32()/u32().
How to fix it
The registry's hint: bool is not a numeric type — use a comparison/logical op, or cast first
See also
-
TS8003TYPE_MISMATCH - Two types that do not fit where they meet (an operator, a condition, a declaration, a return or an argument), a read of an optional value (
T | undefined,T | nullorT | null | undefined) that no test narrowed (Rule 7.10), or a constant the compiler folds that WGSL refuses: a shift amount past 31, a divisor of 0, clamp bounds that cross, anf32past its range or a builtin call outside its domain, such asMath.pow(-2., 2.).
Source
Where the compiler raises this code at commit af54ddad5, one line per file: