Browse Source

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

Sven/Sarah Barth 2 năm trước cách đây
mục cha
commit
1d73dab2b0
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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;