From: Mikko Rasa Date: Mon, 11 Apr 2022 11:22:25 +0000 (+0300) Subject: Refactor function call argument type resolving logic a bit X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=ac876d8c2ea01e0383709a8a045c3e592c9564eb Refactor function call argument type resolving logic a bit --- diff --git a/source/glsl/resolve.cpp b/source/glsl/resolve.cpp index 115624c4..82c0a367 100644 --- a/source/glsl/resolve.cpp +++ b/source/glsl/resolve.cpp @@ -1089,6 +1089,11 @@ void ExpressionResolver::visit(FunctionCall &call) { TypeDeclaration *arg_type = call.arguments[i]->type; TypeDeclaration *param_type = call.declaration->parameters[i]->type_declaration; + if(arg_type==param_type) + continue; + else if(!arg_type || !param_type) + return; + BasicTypeDeclaration *arg_basic = dynamic_cast(arg_type); BasicTypeDeclaration *param_basic = dynamic_cast(param_type); if(arg_basic && param_basic) @@ -1097,8 +1102,6 @@ void ExpressionResolver::visit(FunctionCall &call) if(compat==RIGHT_CONVERTIBLE) convert_to(call.arguments[i], *param_basic); } - else if(!arg_type || !param_type || arg_type!=param_type) - return; } resolve(call, call.declaration->return_type_declaration, false); }