Browse Source

* Fix from Mattias Gaertner for System.Delete() use analyses.

git-svn-id: trunk@35703 -
michael 8 years ago
parent
commit
9e39442dbc

+ 2 - 0
packages/fcl-passrc/src/pasuseanalyzer.pas

@@ -607,6 +607,8 @@ begin
     UseExpr(TPasExpr(El))
     UseExpr(TPasExpr(El))
   else if C=TPasEnumValue then
   else if C=TPasEnumValue then
     MarkElementAsUsed(El)
     MarkElementAsUsed(El)
+  else if C.InheritsFrom(TPasModule) then
+    // e.g. unitname.identifier -> the module is used by the identifier
   else
   else
     RaiseNotSupported(20170307090947,El);
     RaiseNotSupported(20170307090947,El);
 end;
 end;

+ 2 - 0
packages/fcl-passrc/tests/tcuseanalyzer.pas

@@ -1134,8 +1134,10 @@ begin
   StartProgram(false);
   StartProgram(false);
   Add('var {#a_notused}a: longint;');
   Add('var {#a_notused}a: longint;');
   Add('var {#b_used}b: longint;');
   Add('var {#b_used}b: longint;');
+  Add('var {#c_used}c: longint;');
   Add('begin');
   Add('begin');
   Add('  b:=2;');
   Add('  b:=2;');
+  Add('  afile.c:=3;');
   AnalyzeWholeProgram;
   AnalyzeWholeProgram;
 end;
 end;