}
ANN static m_bool _check_lambda(const Env env, Exp_Lambda *l, const Func_Def def) {
- Arg_List base = def->base->args, arg = l->args;
+ Arg_List base = def->base->args, arg = l->def->base->args;
while(base && arg) {
arg->td = base->td;
base = base->next;
}
if(base || arg)
ERR_B(exp_self(l)->pos, _("argument number does not match for lambda"))
- l->def = new_func_def(env->gwion->mp,
- new_func_base(env->gwion->mp, def->base->td, l->name, l->args),
- l->code, def->flag, loc_cpy(env->gwion->mp, def->pos));
+ l->def->flag = def->flag;
+ l->def->base->td = cpy_type_decl(env->gwion->mp, def->base->td);
+// l->def = new_func_def(env->gwion->mp,
+// new_func_base(env->gwion->mp, def->base->td, l->name, l->args),
+// l->code, def->flag, loc_cpy(env->gwion->mp, def->pos));
CHECK_BB(traverse_func_def(env, l->def))
- arg = l->args;
+ arg = l->def->base->args;
while(arg) {
arg->td = NULL;
arg = arg->next;
if(exp->args)
CHECK_OO(check_exp(env, exp->args))
Exp_Lambda *l = &exp->func->d.exp_lambda;
- Arg_List arg = l->args;
+ Arg_List arg = l->def->base->args;
Exp e = exp->args;
while(arg && e) {
arg->type = e->type;
}
if(arg || e)
ERR_O(exp_self(exp)->pos, _("argument number does not match for lambda"))
- l->def = new_func_def(env->gwion->mp, new_func_base(env->gwion->mp, NULL, l->name, l->args),
- l->code, 0, loc_cpy(env->gwion->mp, exp_self(exp)->pos));
CHECK_BO(traverse_func_def(env, l->def))
if(env->class_def)
SET_FLAG(l->def, member);