Sfoglia il codice sorgente

* a callnode for an anonymous function can have its procdefinition fixed, thus avoid the need to check for overloads

Sven/Sarah Barth 2 anni fa
parent
commit
1d73dab2b0
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      compiler/pexpr.pas

+ 4 - 0
compiler/pexpr.pas

@@ -1155,6 +1155,10 @@ implementation
                end
              else
                p1:=ccallnode.create(para,tprocsym(sym),st,p1,callflags,spezcontext);
+             { in case of calling an anonynmous function we already know the concrete
+               procdef that is going to be called }
+             if (tprocsym(sym).ProcdefList.count=1) and (po_anonymous in tprocdef(tprocsym(sym).procdeflist[0]).procoptions) then
+               tcallnode(p1).procdefinition:=tprocdef(tprocsym(sym).procdeflist[0]);
            end;
          afterassignment:=prevafterassn;
       end;