* set the type of the hidden $vmt parameter to the correct classrefdef and

adjust the parameter comparison code to ignore types of $vmt parameters
    when comparing (previously they were all voidpointer and hence also
    equal)

git-svn-id: trunk@30955 -
This commit is contained in:
Jonas Maebe 2015-05-31 16:51:02 +00:00
parent e9800ad3f9
commit dd3d0ae5bc
3 changed files with 7 additions and 11 deletions

View File

@ -2010,15 +2010,18 @@ implementation
if (vo_is_hidden_para in currpara1.varoptions)<>(vo_is_hidden_para in currpara2.varoptions) then
exit;
eq:=te_exact;
if not(vo_is_self in currpara1.varoptions) and
not(vo_is_self in currpara2.varoptions) then
if (([vo_is_self,vo_is_vmt]*currpara1.varoptions)=[]) and
(([vo_is_self,vo_is_vmt]*currpara2.varoptions)=[]) then
begin
if not(cpo_ignorevarspez in cpoptions) and
(currpara1.varspez<>currpara2.varspez) then
exit;
eq:=compare_defs_ext(currpara1.vardef,currpara2.vardef,nothingn,
convtype,hpd,cdoptions);
end;
end
else if ([vo_is_self,vo_is_vmt]*currpara1.varoptions)<>
([vo_is_self,vo_is_vmt]*currpara2.varoptions) then
eq:=te_incompatible;
end
else
begin

View File

@ -346,11 +346,6 @@ implementation
(po_classmethod in tprocdef(symtableentry.owner.defowner).procoptions) then
resultdef:=cclassrefdef.create(tprocdef(symtableentry.owner.defowner).struct)
end
else if vo_is_vmt in tabstractvarsym(symtableentry).varoptions then
begin
resultdef:=tprocdef(symtableentry.owner.defowner).struct;
resultdef:=cclassrefdef.create(resultdef);
end;
end;
procsym :
begin

View File

@ -225,9 +225,7 @@ implementation
(tobjectdef(tprocdef(pd).struct).extendeddef.typ<>objectdef)
)) then
begin
{ can't use classrefdef as type because inheriting
will then always file because of a type mismatch }
vs:=cparavarsym.create('$vmt',paranr_vmt,vs_value,voidpointertype,[vo_is_vmt,vo_is_hidden_para]);
vs:=cparavarsym.create('$vmt',paranr_vmt,vs_value,cclassrefdef.create(tprocdef(pd).struct),[vo_is_vmt,vo_is_hidden_para]);
pd.parast.insert(vs);
end;