* explicitely store the procdef of the picked constructor of the attribute

git-svn-id: trunk@42400 -
This commit is contained in:
svenbarth 2019-07-12 22:07:41 +00:00
parent dfb9fffcf9
commit 8ce4f9606d
2 changed files with 5 additions and 3 deletions

View File

@ -502,7 +502,7 @@ implementation
to the property which is defined next. }
if not assigned(rtti_attrs_def) then
rtti_attrs_def:=trtti_attribute_list.create;
rtti_attrs_def.addattribute(typesym,pcalln,paras);
rtti_attrs_def.addattribute(typesym,tcallnode(pcalln).procdefinition,pcalln,paras);
end
else
pcalln.free;

View File

@ -62,6 +62,7 @@ interface
trtti_attribute = class
typesym : tsym;
typeconstr : tdef;
constructorcall : tnode;
constructorpd : tdef;
paras : array of tnode;
@ -73,7 +74,7 @@ interface
{ if the attribute list is bound to a def or symbol }
is_bound : Boolean;
class procedure bind(var dangling,owned:trtti_attribute_list);
procedure addattribute(atypesym:tsym;constructorcall:tnode;constref paras:array of tnode);
procedure addattribute(atypesym:tsym;typeconstr:tdef;constructorcall:tnode;constref paras:array of tnode);
destructor destroy; override;
function get_attribute_count:longint;
end;
@ -2937,7 +2938,7 @@ implementation
dangling:=nil;
end;
procedure trtti_attribute_list.addattribute(atypesym:tsym;constructorcall:tnode;constref paras:array of tnode);
procedure trtti_attribute_list.addattribute(atypesym:tsym;typeconstr:tdef;constructorcall:tnode;constref paras:array of tnode);
var
newattribute : trtti_attribute;
i : sizeint;
@ -2946,6 +2947,7 @@ implementation
rtti_attributes:=TFPObjectList.Create(true);
newattribute:=trtti_attribute.Create;
newattribute.typesym:=atypesym;
newattribute.typeconstr:=typeconstr;
newattribute.constructorcall:=constructorcall;
setlength(newattribute.paras,length(paras));
for i:=0 to high(paras) do