* assignment operator search finds best matching operator

git-svn-id: trunk@1469 -
This commit is contained in:
peter 2005-10-18 10:53:11 +00:00
parent 45fbeaad53
commit 7d153beac7

View File

@ -1847,11 +1847,15 @@ implementation
var st:Tsymtable;
sym:Tprocsym;
sv:cardinal;
besteq:tequaltype;
curreq,
besteq : tequaltype;
currpd,
bestpd : tprocdef;
begin
st:=symtablestack;
sv:=getspeedvalue('assign');
besteq:=te_incompatible;
bestpd:=nil;
while st<>nil do
begin
sym:=Tprocsym(st.speedsearch('assign',sv));
@ -1861,12 +1865,18 @@ implementation
internalerror(200402031);
{ if the source type is an alias then this is only the second choice,
if you mess with this code, check tw4093 }
search_assignment_operator:=sym.search_procdef_assignment_operator(from_def,to_def,besteq);
if (search_assignment_operator<>nil) and (besteq=te_exact) then
break;
currpd:=sym.search_procdef_assignment_operator(from_def,to_def,curreq);
if curreq>besteq then
begin
besteq:=curreq;
bestpd:=currpd;
if (besteq=te_exact) then
break;
end;
end;
st:=st.next;
end;
result:=bestpd;
end;
function searchsystype(const s: stringid; var srsym: ttypesym): boolean;