From ea80fefa057a8c7ddf8541e8bd76ebf2c77e1166 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 12 Aug 2024 17:57:14 -0400 Subject: Bugfix some issues with table keys/values --- typecheck.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'typecheck.c') 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; -- cgit v1.2.3