Pārlūkot izejas kodu

+ 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

Sven/Sarah Barth 2 gadi atpakaļ
vecāks
revīzija
78025d90b3
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      compiler/ncal.pas

+ 3 - 2
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