aboutsummaryrefslogtreecommitdiff
path: root/src/compile/indexing.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-09 20:09:22 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-09 20:09:22 -0400
commitba6d1b12291398c804f5cdf653265a0322ca4a01 (patch)
tree7e8c863817a64ec5ba5b1e457d05581bddf00852 /src/compile/indexing.c
parentca9eabb810af3aca14aad5c8e0266ddc9286dd99 (diff)
parentd64dcab138a34d5f5105e08f0a840f7cb5a1d159 (diff)
Merge branch 'main' into simplified-quotessimplified-quotes
Diffstat (limited to 'src/compile/indexing.c')
-rw-r--r--src/compile/indexing.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compile/indexing.c b/src/compile/indexing.c
index 39af1160..1510e924 100644
--- a/src/compile/indexing.c
+++ b/src/compile/indexing.c
@@ -52,13 +52,13 @@ Text_t compile_indexing(env_t *env, ast_t *ast) {
if (table_type->default_value) {
return Texts("Table$get_or_default(", 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), ", ",
+ compile_to_type(env, indexing->index, table_type->key_type), ", ",
compile_to_type(env, table_type->default_value, table_type->value_type), ", ",
compile_type_info(container_t), ")");
} else {
return Texts("Table$get_optional(", 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),
+ compile_to_type(env, indexing->index, table_type->key_type),
", "
"_, ",
promote_to_optional(table_type->value_type, Text("(*_)")), ", ",