aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
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);