Codetool: FindDeclaration, fix "generic array" in fdt_generics_finddeclaration.pas / Fix issue #39738

This commit is contained in:
Martin 2022-10-20 21:39:46 +02:00
parent a8b58da637
commit f47e51faf4

View File

@ -4724,6 +4724,15 @@ var
or StartContextNode.HasAsParent(ContextNode) then
// searching an ancestor => don't search within ancestors
Exclude(Flags,fdfSearchInAncestors);
end else if ContextNode.Desc=ctnGenericParams then begin
if SearchInGenericParams(ContextNode) then begin
FindIdentifierInContext:=true;
{$IFDEF ShowCollect}
if fdfCollect in Flags then
raise Exception.Create('fdfCollect must never return true');
{$ENDIF}
exit(AbortNoCacheResult);
end;
end;
if (ContextNode=StartContextNode)
@ -13201,15 +13210,6 @@ begin
if (ArrayNode=nil) then exit;
if (ArrayNode.Desc<>ctnOpenArrayType) and (ArrayNode.Desc<>ctnRangedArrayType)
then exit;
if (ArrayNode.Parent <> nil)
and (ArrayNode.Parent.Desc = ctnGenericType)
and (ParentParams <> nil) then begin
// TODO: make sure there is ONLY ONE GenParam
ExprType.Desc := xtContext;
ExprType.Context.Node := ParentParams.GenParams.SpecializeParamsNode.FirstChild;
ExprType.Context.Tool := ParentParams.GenParams.ParamValuesTool;
Result:=true;
end else begin
MoveCursorToNodeStart(ArrayNode);
ReadNextAtom; // array
if not UpAtomIs('ARRAY') then exit;
@ -13233,7 +13233,6 @@ begin
finally
Params.Free;
end;
end;
end;
function TFindDeclarationTool.CheckOperatorEnumerator(