mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 12:39:36 +02:00
fcl-passrc: added separate error message duplicate published method
git-svn-id: trunk@42287 -
This commit is contained in:
parent
c914655a67
commit
c971b4639f
@ -189,6 +189,7 @@ const
|
||||
nCreatingAnInstanceOfAbstractClassY = 3123;
|
||||
nIllegalExpressionAfterX = 3124;
|
||||
nMethodHidesNonVirtualMethodExactly = 3125;
|
||||
nDuplicatePublishedMethodXAtY = 3126;
|
||||
|
||||
// using same IDs as FPC
|
||||
nVirtualMethodXHasLowerVisibility = 3250; // was 3050
|
||||
@ -325,6 +326,7 @@ resourcestring
|
||||
sCreatingAnInstanceOfAbstractClassY = 'Creating an instance of abstract class "%s"';
|
||||
sIllegalExpressionAfterX = 'illegal expression after %s';
|
||||
sMethodHidesNonVirtualMethodExactly = 'method hides identifier at "%s". Use reintroduce';
|
||||
sDuplicatePublishedMethodXAtY = 'Duplicate published method "%s" at %s';
|
||||
|
||||
type
|
||||
{ TResolveData - base class for data stored in TPasElement.CustomData }
|
||||
|
@ -5005,7 +5005,13 @@ begin
|
||||
and (OlderIdentifier.Element.Parent.Parent<>Scope.Element) then
|
||||
// this enum was propagated from a sub type -> remove enum
|
||||
Scope.RemoveLocalIdentifier(OlderIdentifier.Element);
|
||||
RaiseMsg(20170216151530,nDuplicateIdentifier,sDuplicateIdentifier,
|
||||
if (El.Visibility=visPublished) and (El is TPasProcedure)
|
||||
and (OlderIdentifier.Element is TPasProcedure) then
|
||||
RaiseMsg(20190626175432,nDuplicatePublishedMethodXAtY,
|
||||
sDuplicatePublishedMethodXAtY,
|
||||
[aName,GetElementSourcePosStr(OlderIdentifier.Element)],El)
|
||||
else
|
||||
RaiseMsg(20170216151530,nDuplicateIdentifier,sDuplicateIdentifier,
|
||||
[aName,GetElementSourcePosStr(OlderIdentifier.Element)],El);
|
||||
end;
|
||||
|
||||
|
@ -11326,7 +11326,7 @@ begin
|
||||
Add('procedure TObject.DoIt; begin end;');
|
||||
Add('procedure TObject.DoIt(i: longint); begin end;');
|
||||
Add('begin');
|
||||
CheckResolverException(sDuplicateIdentifier,nDuplicateIdentifier);
|
||||
CheckResolverException(sDuplicatePublishedMethodXAtY,nDuplicatePublishedMethodXAtY);
|
||||
end;
|
||||
|
||||
procedure TTestResolver.TestNestedClass;
|
||||
|
Loading…
Reference in New Issue
Block a user