* give an error if the same method declaration is added twice to an

interface/class/object (mantis 8019)

git-svn-id: trunk@5721 -
This commit is contained in:
Jonas Maebe 2006-12-26 18:12:56 +00:00
parent f6473ac074
commit 66a07eba3e
3 changed files with 31 additions and 3 deletions

1
.gitattributes vendored
View File

@ -6993,6 +6993,7 @@ tests/webtbf/tw7322.pp svneol=native#text/plain
tests/webtbf/tw7438.pp svneol=native#text/plain
tests/webtbf/tw7438a.pp svneol=native#text/plain
tests/webtbf/tw7989.pp svneol=native#text/plain
tests/webtbf/tw8019.pp svneol=native#text/plain
tests/webtbf/uw0744.pp svneol=native#text/plain
tests/webtbf/uw0840a.pp svneol=native#text/plain
tests/webtbf/uw0840b.pp svneol=native#text/plain

View File

@ -280,7 +280,9 @@ implementation
begin
if is_visible then
procdefcoll^.hidden:=true;
if (_class=pd._class) and not(po_reintroduce in pd.procoptions) then
if (pd._class=procdefcoll^.data._class) then
MessagePos(pd.fileinfo,parser_e_overloaded_have_same_parameters)
else if (_class=pd._class) and not(po_reintroduce in pd.procoptions) then
MessagePos1(pd.fileinfo,parser_w_should_use_override,pd.fullprocname(false));
end;
end
@ -299,7 +301,9 @@ implementation
begin
if is_visible then
procdefcoll^.hidden:=true;
if (_class=pd._class) and not(po_reintroduce in pd.procoptions) then
if (pd._class=procdefcoll^.data._class) then
MessagePos(pd.fileinfo,parser_e_overloaded_have_same_parameters)
else if (_class=pd._class) and not(po_reintroduce in pd.procoptions) then
MessagePos1(pd.fileinfo,parser_w_should_use_override,pd.fullprocname(false));
end;
end
@ -374,7 +378,9 @@ implementation
begin
if is_visible then
procdefcoll^.hidden:=true;
if (_class=pd._class) and not(po_reintroduce in pd.procoptions) then
if (pd._class=procdefcoll^.data._class) then
MessagePos(pd.fileinfo,parser_e_overloaded_have_same_parameters)
else if (_class=pd._class) and not(po_reintroduce in pd.procoptions) then
MessagePos1(pd.fileinfo,parser_w_should_use_override,pd.fullprocname(false));
end;
end;

21
tests/webtbf/tw8019.pp Normal file
View File

@ -0,0 +1,21 @@
{ %fail }
{$mode delphi}
program test2;
type
XResult = integer;
XStr = integer;
PDNSEntry = ^XDNSEntry;
XDNSEntry =
record
end;
itest = interface(iunknown)
function GetHostByName(const Name: XStr; out Res: PDNSEntry): XResult;
function GetHostByName(const Name: XStr; out Res: XDNSEntry): XResult;
end;
begin
end.