diff --git a/src/tint/writer/wgsl/generator_impl.cc b/src/tint/writer/wgsl/generator_impl.cc index c0520754f8..69aaabd05a 100644 --- a/src/tint/writer/wgsl/generator_impl.cc +++ b/src/tint/writer/wgsl/generator_impl.cc @@ -1149,7 +1149,7 @@ bool GeneratorImpl::EmitReturn(const ast::ReturnStatement* stmt) { bool GeneratorImpl::EmitConstAssert(const ast::ConstAssert* stmt) { auto out = line(); - out << "static_assert "; + out << "const_assert "; if (!EmitExpression(out, stmt->condition)) { return false; } diff --git a/src/tint/writer/wgsl/generator_impl_const_assert_test.cc b/src/tint/writer/wgsl/generator_impl_const_assert_test.cc index 9f76d65a29..b7853570c6 100644 --- a/src/tint/writer/wgsl/generator_impl_const_assert_test.cc +++ b/src/tint/writer/wgsl/generator_impl_const_assert_test.cc @@ -27,7 +27,7 @@ TEST_F(WgslGeneratorImplTest, Emit_GlobalConstAssert) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_EQ(gen.result(), R"(static_assert true; + EXPECT_EQ(gen.result(), R"(const_assert true; )"); } @@ -38,7 +38,7 @@ TEST_F(WgslGeneratorImplTest, Emit_FunctionConstAssert) { ASSERT_TRUE(gen.Generate()) << gen.error(); EXPECT_EQ(gen.result(), R"(fn f() { - static_assert true; + const_assert true; } )"); }