mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 12:18:17 +02:00
codetools: identifier completion: fixed checking for overloaded procs
git-svn-id: trunk@41498 -
This commit is contained in:
parent
efec9f2a26
commit
81d66a4964
@ -1134,9 +1134,15 @@ begin
|
|||||||
Ident:=FoundContext.Tool.GetProcNameIdentifier(FoundContext.Node);
|
Ident:=FoundContext.Tool.GetProcNameIdentifier(FoundContext.Node);
|
||||||
NewItem := CurrentIdentifierList.FindIdentifier(Ident);
|
NewItem := CurrentIdentifierList.FindIdentifier(Ident);
|
||||||
if (NewItem<>nil) and (NewItem.Tool<>nil) then begin
|
if (NewItem<>nil) and (NewItem.Tool<>nil) then begin
|
||||||
if (Lvl > NewItem.Level + 1)
|
if (Lvl > NewItem.Level + 1) then
|
||||||
or ((Lvl <> NewItem.Level) and not NewItem.Tool.ProcNodeHasSpecifier(NewItem.Node, psOVERLOAD))
|
Ident := nil // there is a previous declaration which can not be overloaded
|
||||||
then Ident := nil; // there is a previous declaration without 'overload'
|
else if (Lvl <> NewItem.Level) then begin
|
||||||
|
// there is a previous declaration on same level
|
||||||
|
if (NewItem.Node.Desc<>ctnProcedure)
|
||||||
|
or (not NewItem.Tool.ProcNodeHasSpecifier(NewItem.Node, psOVERLOAD))
|
||||||
|
then
|
||||||
|
Ident := nil; // there is a previous declaration without 'overload'
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1260,6 +1260,14 @@ function TPascalReaderTool.ProcNodeHasSpecifier(ProcNode: TCodeTreeNode;
|
|||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if ProcNode=nil then exit;
|
if ProcNode=nil then exit;
|
||||||
|
{$IFDEF CheckNodeTool}
|
||||||
|
if ProcNode.Desc<>ctnProcedure then begin
|
||||||
|
DebugLn(['TPascalReaderTool.ProcNodeHasSpecifier Desc=',ProcNode.DescAsString]);
|
||||||
|
CTDumpStack;
|
||||||
|
RaiseException('[TPascalReaderTool.ProcNodeHasSpecifier] '
|
||||||
|
+'internal error: invalid ProcNode');
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
if (ProcNode.FirstChild=nil)
|
if (ProcNode.FirstChild=nil)
|
||||||
or ((ProcNode.SubDesc and ctnsNeedJITParsing)>0) then
|
or ((ProcNode.SubDesc and ctnsNeedJITParsing)>0) then
|
||||||
BuildSubTreeForProcHead(ProcNode);
|
BuildSubTreeForProcHead(ProcNode);
|
||||||
|
Loading…
Reference in New Issue
Block a user