ANN static Type check_lambda_call(const Env env, Exp_Call *const exp) {
const Func_Def fdef = exp->func->d.exp_lambda.def;
+ const bool captures = !!fdef->captures;
if (exp->args) CHECK_BO(lambda_args_ref(env, exp));
- const Exp _args = !fdef->captures ? NULL : check_lambda_captures(env, fdef);
- if(fdef->captures) CHECK_BO(lambda_append_args(env, exp, _args));
+ const Exp _args = !captures ? NULL : check_lambda_captures(env, fdef);
+ if(captures) CHECK_BO(lambda_append_args(env, exp, _args));
Exp_Lambda *l = &exp->func->d.exp_lambda;
Arg_List args = l->def->base->args;
Exp e = exp->args;
ANN Type partial_type(const Env env, Exp_Call *const call) {
const Func base = call->func->type->info->func;
- if(!base) ERR_O(call->func->pos, _("can't partially apply call a literal lambda"));
+ if(!base) ERR_O(call->func->pos, _("can't do partiall application on a literal lambda"));
const Func f = partial_match(env, base, call->args, call->func->pos);
if(!f) {
const Exp e = expand(env, call->func->type->info->func, call->args, call->func->pos);