self->params = NULL;
self->func = funcexpr;
+/*
self->expression.vtype = funcexpr->expression.next->expression.vtype;
if (funcexpr->expression.next->expression.next)
self->expression.next = ast_type_copy(ctx, funcexpr->expression.next->expression.next);
+*/
+ ast_type_adopt(self, funcexpr->expression.next);
return self;
}
} else {
*out = ir_block_create_load_from_ent(func->curblock, ast_ctx(self), ast_function_label(func, "efv"),
ent, field, self->expression.vtype);
+ if ((*out)->vtype == TYPE_FIELD)
+ (*out)->fieldtype = self->expression.next->expression.vtype;
+ if ((*out)->vtype == TYPE_FUNCTION)
+ (*out)->outtype = self->expression.next->expression.vtype;
}
if (!*out) {
compile_error(ast_ctx(self), "failed to create %s instruction (output type %s)",
*out = ir_call_value(callinstr);
self->expression.outr = *out;
+ if ((*out)->vtype == TYPE_FIELD)
+ (*out)->fieldtype = self->expression.next->expression.vtype;
+ if ((*out)->vtype == TYPE_FUNCTION)
+ (*out)->outtype = self->expression.next->expression.vtype;
+
vec_free(params);
return true;
error: