mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-21 09:19:27 +02:00
fcl-passrc: useanalyzer: when member needs typeinfo, mark parent too
This commit is contained in:
parent
a86581a9ea
commit
b11d0f692a
@ -1313,6 +1313,9 @@ begin
|
||||
UseElement(El,rraNone,true);
|
||||
|
||||
UseAttributes(El);
|
||||
|
||||
if El.Parent is TPasMembersType then
|
||||
UseTypeInfo(El.Parent);
|
||||
end;
|
||||
|
||||
procedure TPasAnalyzer.UseAttributes(El: TPasElement);
|
||||
|
@ -2685,7 +2685,9 @@ procedure TTestUseAnalyzer.TestWP_Published;
|
||||
begin
|
||||
StartProgram(false);
|
||||
Add('type');
|
||||
Add(' {#tobject_used}TObject = class');
|
||||
Add(' {#tobject_notypeinfo}TObject = class');
|
||||
Add(' end;');
|
||||
Add(' {#tobject_typeinfo}TBird = class');
|
||||
Add(' private');
|
||||
Add(' {#fcol_used}FCol: string;');
|
||||
Add(' {#fbird_notused}FBird: string;');
|
||||
@ -2695,9 +2697,9 @@ begin
|
||||
Add(' property {#col_used}Col: string read FCol;');
|
||||
Add(' end;');
|
||||
Add('var');
|
||||
Add(' {#o_used}o: TObject;');
|
||||
Add(' {#b_used}b: TBird;');
|
||||
Add('begin');
|
||||
Add(' o:=nil;');
|
||||
Add(' b:=nil;');
|
||||
AnalyzeWholeProgram;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user