Problem analogous to #2450.
For example, here we generate invalid wgsl:
it('...', () => {
const A = d.arrayOf(d.struct({ p: d.u32 }), 4);
const B = d.arrayOf(d.struct({ p: d.f32 }), 4);
const helper = tgpu.fn([B])((b) => {
'use gpu';
});
const main = tgpu.fn([])(() => {
'use gpu';
const a = A();
helper(a);
});
expect(tgpu.resolve([main])).toMatchInlineSnapshot(`
"struct item {
p: u32,
}
struct item_1 {
p: f32,
}
fn helper(b: array<item_1, 4>) {
}
fn main() {
let a = array<item, 4>();
helper(a);
}"
`);
});
Problem analogous to #2450.
For example, here we generate invalid wgsl: