aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-09 14:02:19 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-03-09 14:02:19 -0500
commit955f047e069497be4cbeffa3e0309360aeb1efa7 (patch)
tree20b59546bb79c75d368739959d15c28317e913bd /typecheck.c
parent0921f3723bf7fe7539aa7a5dfdbd921f445777af (diff)
First pass at lambdas/closures
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/typecheck.c b/typecheck.c
index 10f2f1d4..88b9d892 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -396,6 +396,8 @@ type_t *get_type(env_t *env, ast_t *ast)
return t; // Constructor
code_err(call->fn, "This is not a type that has a constructor");
}
+ if (fn_type_t->tag == ClosureType)
+ fn_type_t = Match(fn_type_t, ClosureType)->fn;
if (fn_type_t->tag != FunctionType)
code_err(call->fn, "This isn't a function, it's a %T", fn_type_t);
auto fn_type = Match(fn_type_t, FunctionType);