* don't allow properties to expose private fields of parent classes

(mantis )

git-svn-id: trunk@13794 -
This commit is contained in:
Jonas Maebe 2009-10-02 13:50:52 +00:00
parent da8355c830
commit 1eceb2ca65
4 changed files with 36 additions and 0 deletions

2
.gitattributes vendored
View File

@ -8711,6 +8711,8 @@ tests/webtbf/tw14104b.pp svneol=native#text/plain
tests/webtbf/tw14104c.pp svneol=native#text/plain
tests/webtbf/tw14248.pp svneol=native#text/plain
tests/webtbf/tw1432.pp svneol=native#text/plain
tests/webtbf/tw14650.pp svneol=native#text/plain
tests/webtbf/tw14650a.pp svneol=native#text/plain
tests/webtbf/tw1467.pp svneol=native#text/plain
tests/webtbf/tw1483.pp svneol=native#text/plain
tests/webtbf/tw1599.pp svneol=native#text/plain

View File

@ -88,6 +88,9 @@ implementation
searchsym(pattern,sym,srsymtable);
if assigned(sym) then
begin
if assigned(aclass) and
not is_visible_for_object(sym,aclass) then
Message(parser_e_cant_access_private_member);
case sym.typ of
fieldvarsym :
begin

16
tests/webtbf/tw14650.pp Normal file
View File

@ -0,0 +1,16 @@
{ %fail }
{$mode objfpc}
type
tc = class
strict private
fa: longint;
end;
tcc = class(tc)
property a: longint read fa;
end;
begin
end.

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

@ -0,0 +1,15 @@
{ %fail }
{$mode objfpc}
uses
classes;
type
TPublicQueueList = class(tfplist)
public
property List: PPointerList read FList;
end;
begin
end.