aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/typecheck.c b/typecheck.c
index eb186dff..9284da57 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -718,7 +718,7 @@ type_t *get_type(env_t *env, ast_t *ast)
return Match(value_t, ArrayType)->item_type;
code_err(indexing->index, "I only know how to index lists using integers, not %T", index_t);
} else if (value_t->tag == TableType) {
- code_err(ast, "Tables use the table:get(key) method, not square bracket indexing like table[key]");
+ return Type(OptionalType, Match(value_t, TableType)->value_type);
} else {
code_err(ast, "I don't know how to index %T values", indexed_t);
}