tint/resolver: Remove logic for module-scope let

This has been replaced with module-scope const.

Change-Id: I03d5e076cf150d2931c9cfb1c6025e98200d91a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95947
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-07-15 09:17:29 +00:00 committed by Dawn LUCI CQ
parent e52cc0419e
commit 32bdf41ed3
1 changed files with 0 additions and 17 deletions

View File

@ -585,14 +585,6 @@ bool Validator::GlobalVariable(
return Var(global);
},
[&](const ast::Let*) {
if (!decl->attributes.empty()) {
AddError("attribute is not valid for module-scope 'let' declaration",
decl->attributes[0]->source);
return false;
}
return Let(global);
},
[&](const ast::Override*) {
for (auto* attr : decl->attributes) {
if (auto* id_attr = attr->As<ast::IdAttribute>()) {
@ -777,15 +769,6 @@ bool Validator::Let(const sem::Variable* v) const {
auto* decl = v->Declaration();
auto* storage_ty = v->Type()->UnwrapRef();
if (v->Is<sem::GlobalVariable>()) {
auto name = symbols_.NameFor(decl->symbol);
if (sem::ParseBuiltinType(name) != sem::BuiltinType::kNone) {
AddError("'" + name + "' is a builtin and cannot be redeclared as a 'let'",
decl->source);
return false;
}
}
if (!(storage_ty->IsConstructible() || storage_ty->Is<sem::Pointer>())) {
AddError(sem_.TypeNameOf(storage_ty) + " cannot be used as the type of a 'let'",
decl->source);