In the spec, evaluating let x = -1.0f * mat2x2f(); is supposed to be different than evaluating let y = mat2x2f(); let x = -1.0f * y;. In the second example, the right side expression is not a const expression, but a runtime expression. In order to catch more edge cases and for the sake of completeness, I propose that there should be test coverage for the first scenario, where the right side is a const expression.
In the specific case that was a bug in naga, evaluating -mat2x2f() did not produce an error, even though a matrix type does not satisfy the precondition of the arithmetic negation operator. This was not caught despite the fact that arithmetic unary operator cts tests are enabled.
gfx-rs/wgpu#10036
In the spec, evaluating
let x = -1.0f * mat2x2f();is supposed to be different than evaluatinglet y = mat2x2f(); let x = -1.0f * y;. In the second example, the right side expression is not a const expression, but a runtime expression. In order to catch more edge cases and for the sake of completeness, I propose that there should be test coverage for the first scenario, where the right side is a const expression.In the specific case that was a bug in naga, evaluating
-mat2x2f()did not produce an error, even though a matrix type does not satisfy the precondition of the arithmetic negation operator. This was not caught despite the fact that arithmetic unary operator cts tests are enabled.gfx-rs/wgpu#10036