From 78025d90b3ee3aec45bb100d2bb01e3d931391fc Mon Sep 17 00:00:00 2001 From: Sven/Sarah Barth Date: Fri, 30 Jun 2023 17:11:43 +0200 Subject: [PATCH] + add a tcallnodeflag value that prohibits the tcallnode.pass_typecheck to return a procvar in case of a call without parameters with a found symbol, but no suitable procdef --- compiler/ncal.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/ncal.pas b/compiler/ncal.pas index cfb3cf2d94..f492a74d3d 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -58,7 +58,8 @@ interface (to prevent it from potentially happening again in a wrong context in case of constant propagation or so) } cnf_ignore_visibility, { internally generated call that should ignore visibility checks } cnf_check_fpu_exceptions, { after the call fpu exceptions shall be checked } - cnf_ignore_devirt_wpo { ignore this call for devirtualisation info tracking: calls to newinstance generated by the compiler do not result in extra class types being instanced } + cnf_ignore_devirt_wpo, { ignore this call for devirtualisation info tracking: calls to newinstance generated by the compiler do not result in extra class types being instanced } + cnf_no_convert_procvar { don't convert a procdef to a procvar } ); tcallnodeflags = set of tcallnodeflag; @@ -3775,7 +3776,7 @@ implementation { in tp mode we can try to convert to procvar if there are no parameters specified } if not(assigned(left)) and - not(cnf_inherited in callnodeflags) and + ([cnf_inherited,cnf_no_convert_procvar]*callnodeflags=[]) and ((m_tp_procvar in current_settings.modeswitches) or (m_mac_procvar in current_settings.modeswitches)) and (not assigned(methodpointer) or