Browse Source

fcl-passrc: when using members, use parent type

mattias 6 years ago
parent
commit
caf8017e04
1 changed files with 7 additions and 3 deletions
  1. 7 3
      compiler/packages/fcl-passrc/src/pasuseanalyzer.pas

+ 7 - 3
compiler/packages/fcl-passrc/src/pasuseanalyzer.pas

@@ -1020,7 +1020,10 @@ begin
   repeat
   repeat
     El:=El.Parent;
     El:=El.Parent;
     if not (El is TPasType) then break;
     if not (El is TPasType) then break;
-    MarkElementAsUsed(El);
+    UseType(TPasType(El),paumElement);
+    //MarkElementAsUsed(El);
+    //if El is TPasMembersType then
+    //  UseClassConstructor(TPasMembersType(El));
   until false;
   until false;
 end;
 end;
 
 
@@ -1955,6 +1958,9 @@ begin
     else
     else
       begin
       begin
       if ElementVisited(El,Mode) then exit;
       if ElementVisited(El,Mode) then exit;
+      // this class has been used (e.g. paumElement), which marked ancestors
+      // and published members
+      // -> now mark all members paumAllPasUsable
       FirstTime:=false;
       FirstTime:=false;
       end;
       end;
     end;
     end;
@@ -1981,8 +1987,6 @@ begin
       end;
       end;
 
 
     ClassScope:=aClass.CustomData as TPasClassScope;
     ClassScope:=aClass.CustomData as TPasClassScope;
-    if ClassScope=nil then
-      exit; // ClassScope can be nil if msIgnoreInterfaces
 
 
     if FirstTime then
     if FirstTime then
       begin
       begin