Insane test case:
function main() {
'use gpu';
const boid = Boid();
const runtimeBool = false;
const x = runtimeBool ? boid.pos : boid.vel;
// should have to require: const x = runtimeBool ? d.vec3f(boid.pos) : d.vec3f(boid.vel);
const y = boid.pos;
return x;
}
expect(tgpu.resolve([main])).toMatchInlineSnapshot(`
"struct Boid {
pos: vec3f,
vel: vec3f,
}
fn main() -> vec3f {
var boid = Boid();
const runtimeBool = false;
let x = select(boid.vel, boid.pos, runtimeBool);
let y = (&boid.pos);
return x;
}"
`);
Insane test case: