Codetools: Include fdfSearchInAncestors when resolving aliases, specializations or properties. "procedure SearchIdentifier" in "TFindDeclarationTool.FindBaseTypeOfNode". Fix issue #39498

Added test
This commit is contained in:
Martin 2022-03-11 16:51:17 +01:00
parent 0e3c87e83d
commit de1c148c6e
2 changed files with 3 additions and 2 deletions

View File

@ -194,6 +194,7 @@ const
fdfGlobals = [fdfExceptionOnNotFound, fdfTopLvlResolving,
fdfExtractOperand, fdfPropertyResolving,
fdfOverrideStringTypesWithFirstParamType];
fdfGlobalsAndAncestor = fdfGlobals+[fdfSearchInAncestors];
fdfGlobalsSameIdent = fdfGlobals+[fdfExceptionOnPredefinedIdent,
fdfIgnoreMissingParams, fdfIgnoreUsedUnits, fdfDoNotCache,
fdfOnlyCompatibleProc, fdfSearchInAncestors, fdfCollect, fdfSearchInHelpers];
@ -5268,7 +5269,7 @@ var
debugln(['TFindDeclarationTool.FindBaseTypeOfNode.SearchIdentifier Identifier=',GetIdentifier(@Src[IdentStart])]);
{$ENDIF}
SubParams.Flags:=[fdfSearchInParentNodes,fdfExceptionOnNotFound]
+(fdfGlobals*Params.Flags);
+(fdfGlobalsAndAncestor*Params.Flags);
SubParams.ContextNode:=StartNode.Parent;
if (SubParams.ContextNode.Desc in (AllIdentifierDefinitions))
then begin

View File

@ -25,7 +25,7 @@ type
TAliasBirdWing = TBirdWing{declaration:fdt_nestedaliasclass.TBird.TBirdWing};
TEagleWing = class(TAliasBirdWing{declaration:fdt_nestedaliasclass.TEagle.TAliasBirdWing})
public
procedure Fly; override;
procedure Fly{declaration:fdt_nestedaliasclass.TBird.TBirdWing.Fly}; override;
end;
end;