diff options
Diffstat (limited to 'packages/fcl-passrc')
-rw-r--r-- | packages/fcl-passrc/src/pasresolver.pp | 3 | ||||
-rw-r--r-- | packages/fcl-passrc/src/pasuseanalyzer.pas | 22 |
2 files changed, 21 insertions, 4 deletions
diff --git a/packages/fcl-passrc/src/pasresolver.pp b/packages/fcl-passrc/src/pasresolver.pp index a77e8bdc6a..44278d62a6 100644 --- a/packages/fcl-passrc/src/pasresolver.pp +++ b/packages/fcl-passrc/src/pasresolver.pp @@ -27915,7 +27915,8 @@ begin Templates:=GetProcTemplateTypes(Proc); if (Templates<>nil) and (Templates.Count>0) then exit(false); - if ProcScope.SpecializedFromItem=nil then exit(true); + if ProcScope.SpecializedFromItem=nil then + exit(true); Params:=ProcScope.SpecializedFromItem.Params; for i:=0 to length(Params)-1 do if Params[i] is TPasGenericTemplateType then exit(false); diff --git a/packages/fcl-passrc/src/pasuseanalyzer.pas b/packages/fcl-passrc/src/pasuseanalyzer.pas index d63431b5c7..15fab81629 100644 --- a/packages/fcl-passrc/src/pasuseanalyzer.pas +++ b/packages/fcl-passrc/src/pasuseanalyzer.pas @@ -1079,6 +1079,7 @@ function TPasAnalyzer.CanSkipGenericProc(DeclProc: TPasProcedure): boolean; var Templates: TFPList; + Parent: TPasElement; begin Result:=false; if ScopeModule=nil then @@ -1093,14 +1094,29 @@ begin Templates:=Resolver.GetProcTemplateTypes(DeclProc); if (Templates<>nil) and (Templates.Count>0) then begin - // generic template + // generic procedure if paoSkipGenericProc in Options then - exit(true); // + exit(true); // emit no hints for generic proc // -> analyze end else if not Resolver.IsFullySpecialized(DeclProc) then // half specialized -> skip - exit(true); + exit(true) + else if paoSkipGenericProc in Options then + begin + Parent:=DeclProc.Parent; + while Parent<>nil do + begin + if (Parent is TPasGenericType) then + begin + Templates:=TPasGenericType(Parent).GenericTemplateTypes; + if (Templates<>nil) and (Templates.Count>0) then + // procedure of a generic parent -> emit no hints + exit(true); + end; + Parent:=Parent.Parent; + end; + end; end; end; |