feat: let mut 改为 var 关键字声明可变变量

This commit is contained in:
2026-06-05 19:47:00 +08:00
parent a28d33854c
commit ab4cc9a28b
10 changed files with 27 additions and 28 deletions
+1 -1
View File
@@ -683,7 +683,7 @@ static void analyze_node(AstNode* node, Scope* scope, ErrorList* errors, Arena*
}
if (!sym->is_mut) {
error_add(errors, "<sema>", node->loc.line, node->loc.col,
"不能对不可变变量 '%s' 赋值(需用 let mut 声明)",
"不能对不可变变量 '%s' 赋值(需用 var 声明)",
node->as.assign_stmt.name);
node->type.kind = TYPE_ERROR;
break;