aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-12 17:57:14 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-12 17:57:14 -0400
commitea80fefa057a8c7ddf8541e8bd76ebf2c77e1166 (patch)
tree67fb80eb62f1f7a1741867929858012ac672014f /typecheck.c
parent6aabed4fcc6823466e78593b93ceadd095f7463f (diff)
Bugfix some issues with table keys/values
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/typecheck.c b/typecheck.c
index 88d862bb..6616b38f 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -1303,6 +1303,8 @@ bool can_be_mutated(env_t *env, ast_t *ast)
case FieldAccess: {
auto access = Match(ast, FieldAccess);
type_t *fielded_type = get_type(env, access->fielded);
+ if (fielded_type->tag == TableType && streq(access->field, "values"))
+ return false;
if (fielded_type->tag == PointerType) {
auto ptr = Match(fielded_type, PointerType);
return !ptr->is_readonly;