mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 14:29:21 +02:00
* 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:
parent
e9800ad3f9
commit
dd3d0ae5bc
@ -2010,15 +2010,18 @@ implementation
|
|||||||
if (vo_is_hidden_para in currpara1.varoptions)<>(vo_is_hidden_para in currpara2.varoptions) then
|
if (vo_is_hidden_para in currpara1.varoptions)<>(vo_is_hidden_para in currpara2.varoptions) then
|
||||||
exit;
|
exit;
|
||||||
eq:=te_exact;
|
eq:=te_exact;
|
||||||
if not(vo_is_self in currpara1.varoptions) and
|
if (([vo_is_self,vo_is_vmt]*currpara1.varoptions)=[]) and
|
||||||
not(vo_is_self in currpara2.varoptions) then
|
(([vo_is_self,vo_is_vmt]*currpara2.varoptions)=[]) then
|
||||||
begin
|
begin
|
||||||
if not(cpo_ignorevarspez in cpoptions) and
|
if not(cpo_ignorevarspez in cpoptions) and
|
||||||
(currpara1.varspez<>currpara2.varspez) then
|
(currpara1.varspez<>currpara2.varspez) then
|
||||||
exit;
|
exit;
|
||||||
eq:=compare_defs_ext(currpara1.vardef,currpara2.vardef,nothingn,
|
eq:=compare_defs_ext(currpara1.vardef,currpara2.vardef,nothingn,
|
||||||
convtype,hpd,cdoptions);
|
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
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
@ -346,11 +346,6 @@ implementation
|
|||||||
(po_classmethod in tprocdef(symtableentry.owner.defowner).procoptions) then
|
(po_classmethod in tprocdef(symtableentry.owner.defowner).procoptions) then
|
||||||
resultdef:=cclassrefdef.create(tprocdef(symtableentry.owner.defowner).struct)
|
resultdef:=cclassrefdef.create(tprocdef(symtableentry.owner.defowner).struct)
|
||||||
end
|
end
|
||||||
else if vo_is_vmt in tabstractvarsym(symtableentry).varoptions then
|
|
||||||
begin
|
|
||||||
resultdef:=tprocdef(symtableentry.owner.defowner).struct;
|
|
||||||
resultdef:=cclassrefdef.create(resultdef);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
procsym :
|
procsym :
|
||||||
begin
|
begin
|
||||||
|
@ -225,9 +225,7 @@ implementation
|
|||||||
(tobjectdef(tprocdef(pd).struct).extendeddef.typ<>objectdef)
|
(tobjectdef(tprocdef(pd).struct).extendeddef.typ<>objectdef)
|
||||||
)) then
|
)) then
|
||||||
begin
|
begin
|
||||||
{ can't use classrefdef as type because inheriting
|
vs:=cparavarsym.create('$vmt',paranr_vmt,vs_value,cclassrefdef.create(tprocdef(pd).struct),[vo_is_vmt,vo_is_hidden_para]);
|
||||||
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]);
|
|
||||||
pd.parast.insert(vs);
|
pd.parast.insert(vs);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user