naga
naga copied to clipboard
[wgsl-in] Function with missing return statement is sometimes accepted without an error
This function is accepted, even though it doesn't return anything. Seems like it should be an error.
fn f() -> i32 {
let x = 1 + 1;
}
Strangely, it's only accepted in certain situations. If the let
is changed to var
or the expression is simplified to just 1
then it produces a validation error.