compiler: Don't allow duplicate property/procedure identifiers inside object declaration. The code which allowed this for delphi mode was initially written based on invalid test from mantis . Fixes bug .

git-svn-id: trunk@19564 -
This commit is contained in:
paul 2011-10-31 05:35:40 +00:00
parent f685d67647
commit b8589d98cc
3 changed files with 17 additions and 4 deletions

1
.gitattributes vendored
View File

@ -11002,6 +11002,7 @@ tests/webtbf/tw2037.pp svneol=native#text/plain
tests/webtbf/tw2046.pp svneol=native#text/plain
tests/webtbf/tw2053.pp svneol=native#text/plain
tests/webtbf/tw2053b.pp svneol=native#text/plain
tests/webtbf/tw20580.pp svneol=native#text/pascal
tests/webtbf/tw2070.pp svneol=native#text/plain
tests/webtbf/tw2128.pp svneol=native#text/plain
tests/webtbf/tw2129.pp svneol=native#text/plain

View File

@ -1295,10 +1295,7 @@ implementation
end;
end
else
begin
if not(m_duplicate_names in current_settings.modeswitches) then
result:=inherited checkduplicate(hashedid,sym);
end;
result:=inherited checkduplicate(hashedid,sym);
end;

15
tests/webtbf/tw20580.pp Normal file
View File

@ -0,0 +1,15 @@
{%fail}
{$ifdef fpc}
{$mode delphi}
{$endif}
type
TTestObject = class(TObject)
private
fValue: integer;
protected
property Value: integer read fValue write fValue;
property Value: integer read fValue;
end;
begin
end.