nil check in paramter type checking

This commit is contained in:
Wolfgang Bumiller 2012-12-31 11:30:02 +01:00
parent 5bb9351a3f
commit 819ed10f29

4
ast.c
View file

@ -909,7 +909,9 @@ bool ast_call_check_types(ast_call *self)
count = vec_size(func->expression.params);
for (i = 0; i < count; ++i) {
if (!ast_compare_type(self->params[i], (ast_expression*)(func->expression.params[i]))) {
if (self->params[i]->expression.vtype != TYPE_NIL &&
!ast_compare_type(self->params[i], (ast_expression*)(func->expression.params[i])))
{
char texp[1024];
char tgot[1024];
ast_type_to_string(self->params[i], tgot, sizeof(tgot));