From dcd26bcfcc691f24508a7b6bf04c15042a4668ea Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 17 Sep 2019 22:05:40 +0200 Subject: Fix function call resolved type --- src/ast.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ast.c') diff --git a/src/ast.c b/src/ast.c index 8e102ee..0008785 100644 --- a/src/ast.c +++ b/src/ast.c @@ -743,6 +743,14 @@ static void funccall_resolve(Ast *self, AstCompilerContext *context) { throw(AST_ERR); } + { + FunctionSignature *func_sig = self->resolve_data.type.value.func_sig; + FunctionReturnType *return_type = buffer_begin(&func_sig->return_types); + assert(buffer_get_size(&func_sig->return_types, FunctionReturnType) == 1); + self->resolve_data.type.type = RESOLVED_TYPE_LHS_EXPR; + self->resolve_data.type = return_type->resolved_type; + } + ast = buffer_begin(&func_call->args); ast_end = buffer_end(&func_call->args); for(; ast != ast_end; ++ast) { -- cgit v1.2.3-70-g09d2