mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 12:18:17 +02:00
Codetools: Fix FindDeclaration tool to not finds inaccessible private/protected fields. Issue #22464, patch from Anton
git-svn-id: trunk@40909 -
This commit is contained in:
parent
3cad2a3828
commit
727f6ddd62
@ -8746,8 +8746,7 @@ begin
|
||||
Params.FoundProc^.ExprInputList.Count) then
|
||||
begin
|
||||
// the new proc fits better
|
||||
Params.ChangeFoundProc(FoundContext,ParamCompatibility,
|
||||
CurCompatibilityList);
|
||||
Params.ChangeFoundProc(FoundContext,ParamCompatibility,CurCompatibilityList);
|
||||
CurCompatibilityList:=nil; // set to nil, so that it will not be freed
|
||||
end;
|
||||
end;
|
||||
@ -8758,6 +8757,14 @@ begin
|
||||
FreeMem(CurCompatibilityList);
|
||||
end;
|
||||
end;
|
||||
end else
|
||||
if (FoundContext.Node.Desc=ctnVarDefinition) then begin
|
||||
if not (fdfIgnoreClassVisibility in Params.Flags)
|
||||
and (FoundContext.Tool<>Params.IdentifierTool)
|
||||
and (GetClassVisibility(FoundContext.Node)=ctnClassPrivate) then
|
||||
Result:=ifrProceedSearch
|
||||
else
|
||||
Result:=ifrSuccess;
|
||||
end else begin
|
||||
Result:=ifrSuccess;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user