mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-18 11:52:22 -07:00
Make procedure parameters just named values rather than copied variables
This commit is contained in:
@@ -303,9 +303,13 @@ Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, Operand *rhs)
|
||||
}
|
||||
}
|
||||
|
||||
Entity *e = entity_of_ident(lhs->expr);
|
||||
|
||||
gbString str = expr_to_string(lhs->expr);
|
||||
if (lhs->mode == Addressing_Immutable) {
|
||||
error(lhs->expr, "Cannot assign to an immutable: '%s'", str);
|
||||
} else if (e != nullptr && e->flags & EntityFlag_Param) {
|
||||
error(lhs->expr, "Cannot assign to '%s' which is a procedure parameter", str);
|
||||
} else {
|
||||
error(lhs->expr, "Cannot assign to '%s'", str);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user