mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-27 01:40:03 +00:00
immutable field prefix
This commit is contained in:
+3
-6
@@ -270,13 +270,10 @@ Type *check_assignment_variable(Checker *c, Operand *op_a, AstNode *lhs) {
|
||||
}
|
||||
|
||||
gbString str = expr_to_string(op_b.expr);
|
||||
switch (op_b.mode) {
|
||||
case Addressing_Value:
|
||||
if (e != NULL && e->kind == Entity_Variable && e->Variable.is_immutable) {
|
||||
error_node(op_b.expr, "Cannot assign to an immutable: `%s`", str);
|
||||
} else {
|
||||
error_node(op_b.expr, "Cannot assign to `%s`", str);
|
||||
break;
|
||||
default:
|
||||
error_node(op_b.expr, "Cannot assign to `%s`", str);
|
||||
break;
|
||||
}
|
||||
gb_string_free(str);
|
||||
} break;
|
||||
|
||||
Reference in New Issue
Block a user