SD0002
Core code
binary op on mismatched vectors
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(@location(0) uv: vec2): vec4 { return vec4(vec3(1., 0., 0.) + uv, 1.)}TS8003 error, line 5: Type mismatch: cannot + vec3 and vec2. Vectors must have the same size.
How to fix it
The registry's hint: both operands must be the same vector type, or one must be a scalar
See also
-
TS8003TYPE_MISMATCH - Two types that do not fit where they meet (an operator, a condition, a declaration, a return or an argument), or a constant the compiler folds that WGSL refuses: a shift amount past 31, a divisor of 0, clamp bounds that cross or an f32 past its range.
Source
Where the compiler raises this code at commit 26de7be8, one line per file:
-
src/core/ir/node.ts:227(5 sites)