wgsl: Deprecate 'const' for 'let'

Renamed with:
https://github.com/gpuweb/gpuweb/pull/1574

Bug: tint:699
Change-Id: I4dda868abe4c5bc0cba46bc81d9eb297a0663717
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47141
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-04-08 15:46:17 +00:00
committed by Commit Bot service account
parent fae0aa6e72
commit 571f2b7363
29 changed files with 232 additions and 179 deletions

View File

@@ -48,7 +48,7 @@ TEST_F(ResolverAssignmentValidationTest, AssignIncompatibleTypes) {
TEST_F(ResolverAssignmentValidationTest,
AssignThroughPointerWrongeStoreType_Fail) {
// var a : f32;
// const b : ptr<function,f32> = a;
// let b : ptr<function,f32> = a;
// b = 2;
const auto priv = ast::StorageClass::kFunction;
auto* var_a = Var("a", ty.f32(), priv);
@@ -211,7 +211,7 @@ TEST_F(ResolverAssignmentValidationTest,
TEST_F(ResolverAssignmentValidationTest, AssignThroughPointer_Pass) {
// var a :i32;
// const b : ptr<function,i32> = a;
// let b : ptr<function,i32> = a;
// b = 2;
const auto func = ast::StorageClass::kFunction;
auto* var_a = Var("a", ty.i32(), func, Expr(2), {});
@@ -229,7 +229,7 @@ TEST_F(ResolverAssignmentValidationTest, AssignThroughPointer_Pass) {
TEST_F(ResolverAssignmentValidationTest, AssignToConstant_Fail) {
// {
// const a :i32 = 2;
// let a : i32 = 2;
// a = 2
// }
auto* var = Const("a", ty.i32(), Expr(2));

View File

@@ -259,7 +259,7 @@ TEST_F(ResolverFunctionValidationTest, FunctionVarInitWithParam) {
TEST_F(ResolverFunctionValidationTest, FunctionConstInitWithParam) {
// fn foo(bar : f32){
// const baz : f32 = bar;
// let baz : f32 = bar;
// }
auto* bar = Var("bar", ty.f32(), ast::StorageClass::kFunction);

View File

@@ -78,7 +78,7 @@ TEST_F(ResolverTypeValidationTest, GlobalConstantWithStorageClass_Fail) {
}
TEST_F(ResolverTypeValidationTest, GlobalConstNoStorageClass_Pass) {
// const global_var: f32;
// let global_var: f32;
GlobalConst(Source{{12, 34}}, "global_var", ty.f32());
EXPECT_TRUE(r()->Resolve()) << r()->error();