aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-15 01:59:42 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-15 01:59:42 -0400
commiteccc4e4721f698bd85397cc56d55921f9db2e214 (patch)
tree1b4099723e5c6163d18b5a219386f49f54b10c99 /typecheck.c
parent9c2d7c437d7576b44f4cf0e6b6a293acd7188a5d (diff)
Add binary search method to arrays
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/typecheck.c b/typecheck.c
index 1100aedc..2814bd03 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -728,6 +728,7 @@ type_t *get_type(env_t *env, ast_t *ast)
else if (streq(call->name, "heapify")) return Type(VoidType);
else if (streq(call->name, "heap_push")) return Type(VoidType);
else if (streq(call->name, "heap_pop")) return Match(self_value_t, ArrayType)->item_type;
+ else if (streq(call->name, "binary_search")) return INT_TYPE;
else code_err(ast, "There is no '%s' method for arrays", call->name);
}
case SetType: {