mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-17 04:39:05 +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);
|
UseElement(El,rraNone,true);
|
||||||
|
|
||||||
UseAttributes(El);
|
UseAttributes(El);
|
||||||
|
|
||||||
|
if El.Parent is TPasMembersType then
|
||||||
|
UseTypeInfo(El.Parent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPasAnalyzer.UseAttributes(El: TPasElement);
|
procedure TPasAnalyzer.UseAttributes(El: TPasElement);
|
||||||
|
@ -2685,7 +2685,9 @@ procedure TTestUseAnalyzer.TestWP_Published;
|
|||||||
begin
|
begin
|
||||||
StartProgram(false);
|
StartProgram(false);
|
||||||
Add('type');
|
Add('type');
|
||||||
Add(' {#tobject_used}TObject = class');
|
Add(' {#tobject_notypeinfo}TObject = class');
|
||||||
|
Add(' end;');
|
||||||
|
Add(' {#tobject_typeinfo}TBird = class');
|
||||||
Add(' private');
|
Add(' private');
|
||||||
Add(' {#fcol_used}FCol: string;');
|
Add(' {#fcol_used}FCol: string;');
|
||||||
Add(' {#fbird_notused}FBird: string;');
|
Add(' {#fbird_notused}FBird: string;');
|
||||||
@ -2695,9 +2697,9 @@ begin
|
|||||||
Add(' property {#col_used}Col: string read FCol;');
|
Add(' property {#col_used}Col: string read FCol;');
|
||||||
Add(' end;');
|
Add(' end;');
|
||||||
Add('var');
|
Add('var');
|
||||||
Add(' {#o_used}o: TObject;');
|
Add(' {#b_used}b: TBird;');
|
||||||
Add('begin');
|
Add('begin');
|
||||||
Add(' o:=nil;');
|
Add(' b:=nil;');
|
||||||
AnalyzeWholeProgram;
|
AnalyzeWholeProgram;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user