|
@@ -5059,14 +5059,15 @@ begin
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ if (Data^.Found is TPasProcedure) and IsProcOverride(Proc,TPasProcedure(Data^.Found)) then
|
|
|
|
+ begin
|
|
|
|
+ // already checked the override -> skip
|
|
|
|
+ Data^.LastProc:=Proc;
|
|
|
|
+ exit;
|
|
|
|
+ end;
|
|
|
|
+
|
|
if (Data^.LastProc<>nil) then
|
|
if (Data^.LastProc<>nil) then
|
|
begin
|
|
begin
|
|
- if (TPasProcedureScope(Data^.LastProc.CustomData).OverriddenProc=Proc) then
|
|
|
|
- begin
|
|
|
|
- // already checked the override -> skip
|
|
|
|
- Data^.LastProc:=Proc;
|
|
|
|
- exit;
|
|
|
|
- end;
|
|
|
|
if not IsProcOverloading(Data^.LastProc,Proc) then
|
|
if not IsProcOverloading(Data^.LastProc,Proc) then
|
|
begin
|
|
begin
|
|
Abort:=true;
|
|
Abort:=true;
|
|
@@ -5079,7 +5080,7 @@ begin
|
|
// there is already a previous proc
|
|
// there is already a previous proc
|
|
PrevProc:=TPasProcedure(Data^.Found);
|
|
PrevProc:=TPasProcedure(Data^.Found);
|
|
|
|
|
|
- if (TPasProcedureScope(PrevProc.CustomData).OverriddenProc=Proc) then
|
|
|
|
|
|
+ if IsProcOverride(Proc,TPasProcedureScope(PrevProc.CustomData).OverriddenProc) then
|
|
begin
|
|
begin
|
|
// already checked the override -> skip
|
|
// already checked the override -> skip
|
|
Data^.LastProc:=Proc;
|
|
Data^.LastProc:=Proc;
|
|
@@ -5466,12 +5467,16 @@ begin
|
|
begin
|
|
begin
|
|
// different scopes
|
|
// different scopes
|
|
if DataProc.IsOverride then
|
|
if DataProc.IsOverride then
|
|
|
|
+ // overrides are not overloads
|
|
else if DataProc.IsReintroduced then
|
|
else if DataProc.IsReintroduced then
|
|
|
|
+ // reintroduce do not warn
|
|
|
|
+ else if ProcHasGroupOverload(DataProc) then
|
|
|
|
+ // overload
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
if Store
|
|
if Store
|
|
- or ((Data^.FoundInSameScope=1) // missing 'overload' hints only for the first proc in a scope
|
|
|
|
- and not ProcHasGroupOverload(DataProc)) then
|
|
|
|
|
|
+ or (Data^.FoundInSameScope=1) // missing 'overload' hints only for the first proc in a scope
|
|
|
|
+ then
|
|
begin
|
|
begin
|
|
if (Data^.Kind=fpkMethod) and (Proc.IsVirtual or Proc.IsOverride) then
|
|
if (Data^.Kind=fpkMethod) and (Proc.IsVirtual or Proc.IsOverride) then
|
|
// give a hint, that method hides a virtual method in ancestor
|
|
// give a hint, that method hides a virtual method in ancestor
|
|
@@ -29670,6 +29675,8 @@ var
|
|
Proc, OverriddenProc: TPasProcedure;
|
|
Proc, OverriddenProc: TPasProcedure;
|
|
begin
|
|
begin
|
|
Result:=false;
|
|
Result:=false;
|
|
|
|
+ if AncestorProc=nil then exit;
|
|
|
|
+ if DescendantProc=nil then exit;
|
|
Proc:=DescendantProc;
|
|
Proc:=DescendantProc;
|
|
if not Proc.IsOverride then exit;
|
|
if not Proc.IsOverride then exit;
|
|
if not AncestorProc.IsOverride and not AncestorProc.IsVirtual then exit;
|
|
if not AncestorProc.IsOverride and not AncestorProc.IsVirtual then exit;
|