Skip to content

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

Open
@hasali19

Description

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.

Metadata

Assignees

Labels

area: validationIssues related to validation, diagnostics, and error handlingnagaShader Translatortype: bugSomething isn't working

Type

No type

Projects

  • Status

    No status

Relationships

None yet

Development

No branches or pull requests

Issue actions