naga icon indicating copy to clipboard operation
naga copied to clipboard

[wgsl-in] Function with missing return statement is sometimes accepted without an error

Open hasali19 opened this issue 2 years ago • 0 comments

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.

hasali19 avatar May 18 '22 18:05 hasali19