aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-12-12 14:08:07 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-12-12 14:08:07 -0500
commit5c15238e2f6891340b7bc655e25c4b5e56192784 (patch)
tree6b613e80b628c0363cfc0bbe9d14f12233a70c56
parent10a0a16686fbdf057f83ec8820d8ffe3f7d0cb39 (diff)
Fix for indexing table pointers
-rw-r--r--compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 7c9ecf8a..f17e796b 100644
--- a/compile.c
+++ b/compile.c
@@ -326,7 +326,7 @@ static CORD compile_lvalue(env_t *env, ast_t *ast)
if (t->tag == PointerType && Match(t, PointerType)->is_view)
code_err(subject, "This is a read-only view and you can't mutate its fields");
else
- code_err(subject, "This is an immutable value, you can't assign to its fields");
+ code_err(subject, "This is an immutable %T value, you can't assign to its fields", t);
} else {
code_err(ast, "This is a value of type %T and can't be used as an assignment target", get_type(env, ast));
}
@@ -3657,7 +3657,7 @@ CORD compile(env_t *env, ast_t *ast)
compile_type_info(env, container_t), ")");
} else if (table_type->value_type) {
return CORD_all("Table$get_optional(",
- compile(env, indexing->indexed), ", ",
+ compile_to_pointer_depth(env, indexing->indexed, 0, false), ", ",
compile_type(table_type->key_type), ", ",
compile_type(table_type->value_type), ", ",
compile(env, indexing->index), ", "