mem_d(self);
}
+bool ast_call_check_types(ast_call *self)
+{
+ size_t i;
+ bool retval = true;
+ const ast_expression *func = self->func;
+
+ for (i = 0; i < self->params_count; ++i) {
+ if (!ast_compare_type(self->params[i], (ast_expression*)(func->expression.params[i]))) {
+ asterror(ast_ctx(self), "invalid type for parameter %u in function call",
+ (unsigned int)(i+1));
+ /* we don't immediately return */
+ retval = false;
+ }
+ }
+ return retval;
+}
+
ast_store* ast_store_new(lex_ctx ctx, int op,
ast_expression *dest, ast_expression *source)
{
ast_expression *funcexpr);
void ast_call_delete(ast_call*);
bool ast_call_codegen(ast_call*, ast_function*, bool lvalue, ir_value**);
+bool ast_call_check_types(ast_call*);
MEM_VECTOR_PROTO(ast_call, ast_expression*, params);
MEM_VECTOR_MOVE(params, exprs, call, params);
ast_delete(params);
}
+ if (!ast_call_check_types(call))
+ parser->errors++;
} else {
parseerror(parser, "invalid function call");
return false;