pexpr.pas, sub_expr:

* generate_inline_specialization: fix Delphi-style inline specializations of generic methods

git-svn-id: trunk@32438 -
This commit is contained in:
svenbarth 2015-11-21 15:59:11 +00:00
parent 86f1ca2037
commit b2988ad8c0

View File

@ -3965,26 +3965,29 @@ implementation
end end
else else
begin begin
result:=nil; if gensym.typ=procsym then
{ check if it's a method/class method }
if is_member_read(gensym,gensym.owner,result,parseddef) then
begin begin
{ if we are accessing a owner procsym from the nested } result:=nil;
{ class we need to call it as a class member } { check if it's a method/class method }
if (gensym.owner.symtabletype in [ObjectSymtable,recordsymtable]) and if is_member_read(gensym,gensym.owner,result,parseddef) then
assigned(current_structdef) and (current_structdef<>parseddef) and is_owned_by(current_structdef,parseddef) then
begin begin
result:=cloadvmtaddrnode.create(ctypenode.create(parseddef)); { if we are accessing a owner procsym from the nested }
{ not srsymtable.symtabletype since that can be } { class we need to call it as a class member }
{ withsymtable as well } if (gensym.owner.symtabletype in [ObjectSymtable,recordsymtable]) and
if (gensym.owner.symtabletype in [ObjectSymtable,recordsymtable]) then assigned(current_structdef) and (current_structdef<>parseddef) and is_owned_by(current_structdef,parseddef) then
begin begin
do_member_read(tabstractrecorddef(parseddef),getaddr,gensym,result,again,[],spezcontext); result:=cloadvmtaddrnode.create(ctypenode.create(parseddef));
spezcontext:=nil; { not srsymtable.symtabletype since that can be }
end { withsymtable as well }
else if (gensym.owner.symtabletype in [ObjectSymtable,recordsymtable]) then
{ no procsyms in records (yet) } begin
internalerror(2015092704); do_member_read(tabstractrecorddef(parseddef),getaddr,gensym,result,again,[],spezcontext);
spezcontext:=nil;
end
else
{ no procsyms in records (yet) }
internalerror(2015092704);
end;
end end
else else
begin begin