diff --git a/compiler/nobj.pas b/compiler/nobj.pas index 582e54609f..df059347c0 100644 --- a/compiler/nobj.pas +++ b/compiler/nobj.pas @@ -1105,6 +1105,7 @@ implementation procedure tclassheader.gintfdoonintf(intf: tobjectdef; intfindex: longint); var def: tdef; + hs, mappedname: string; nextexist: pointer; implprocdef: tprocdef; @@ -1117,7 +1118,8 @@ implementation implprocdef:=nil; nextexist:=nil; repeat - mappedname:=_class.implementedinterfaces.getmappings(intfindex,tprocdef(def).procsym.name,nextexist); + hs:=intf.symtable.name^+'.'+tprocdef(def).procsym.name; + mappedname:=_class.implementedinterfaces.getmappings(intfindex,hs,nextexist); if mappedname<>'' then implprocdef:=gintfgetcprocdef(tprocdef(def),mappedname); until assigned(implprocdef) or not assigned(nextexist); diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index a145afe710..8f7cb5e9c5 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -635,6 +635,7 @@ implementation function parse_proc_head(aclass:tobjectdef;potype:tproctypeoption;var pd:tprocdef):boolean; var + hs : string; orgsp,sp : stringid; sym : tsym; srsym : tsym; @@ -690,9 +691,11 @@ implementation if (i=-1) then Message(parser_e_interface_id_expected); consume(_ID); + { Create unique name . } + hs:=sp+'.'+pattern; consume(_EQUAL); if (token=_ID) then - aclass.implementedinterfaces.addmappings(i,sp,pattern); + aclass.implementedinterfaces.addmappings(i,hs,pattern); consume(_ID); result:=true; exit; diff --git a/compiler/symdef.pas b/compiler/symdef.pas index ae215e5dbb..9d822733ce 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -285,8 +285,8 @@ interface procedure addintf_deref(const d:tderef;iofs:longint); procedure clearmappings; - procedure addmappings(intfindex: longint; const name, newname: string); - function getmappings(intfindex: longint; const name: string; var nextexist: pointer): string; + procedure addmappings(intfindex: longint; const origname, newname: string); + function getmappings(intfindex: longint; const origname: string; var nextexist: pointer): string; procedure addimplproc(intfindex: longint; procdef: tprocdef); function implproccount(intfindex: longint): longint; @@ -5063,7 +5063,7 @@ implementation constructor tnamemap.create(const aname, anewname: string); begin - inherited createname(name); + inherited createname(aname); newname:=stringdup(anewname); end; @@ -5237,25 +5237,25 @@ implementation end; end; - procedure timplementedinterfaces.addmappings(intfindex: longint; const name, newname: string); + procedure timplementedinterfaces.addmappings(intfindex: longint; const origname, newname: string); begin checkindex(intfindex); with timplintfentry(finterfaces.search(intfindex)) do begin if not assigned(namemappings) then namemappings:=tdictionary.create; - namemappings.insert(tnamemap.create(name,newname)); + namemappings.insert(tnamemap.create(origname,newname)); end; end; - function timplementedinterfaces.getmappings(intfindex: longint; const name: string; var nextexist: pointer): string; + function timplementedinterfaces.getmappings(intfindex: longint; const origname: string; var nextexist: pointer): string; begin checkindex(intfindex); if not assigned(nextexist) then with timplintfentry(finterfaces.search(intfindex)) do begin if assigned(namemappings) then - nextexist:=namemappings.search(name) + nextexist:=namemappings.search(origname) else nextexist:=nil; end;