From eccc4e4721f698bd85397cc56d55921f9db2e214 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 15 Aug 2024 01:59:42 -0400 Subject: Add binary search method to arrays --- typecheck.c | 1 + 1 file changed, 1 insertion(+) (limited to 'typecheck.c') 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: { -- cgit v1.2.3