From 819ed10f29a8b105540407c049e142b883b07a99 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 31 Dec 2012 11:30:02 +0100 Subject: [PATCH] nil check in paramter type checking --- ast.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ast.c b/ast.c index 9d10cc6..f18499b 100644 --- a/ast.c +++ b/ast.c @@ -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)); -- 2.39.2