* not ignoring private/protected anymore, fixes bug #3969

git-svn-id: trunk@553 -
This commit is contained in:
florian 2005-07-01 20:37:18 +00:00
parent 833a6d40d4
commit bdc8b7d061
5 changed files with 65 additions and 3 deletions

2
.gitattributes vendored
View File

@ -5474,6 +5474,8 @@ tests/webtbf/tw3738.pp svneol=native#text/plain
tests/webtbf/tw3740.pp svneol=native#text/plain
tests/webtbf/tw3790.pp svneol=native#text/plain
tests/webtbf/tw3841.pp svneol=native#text/plain
tests/webtbf/tw3969.pp svneol=native#text/plain
tests/webtbf/tw3969u.pp svneol=native#text/plain
tests/webtbf/tw4103.pp svneol=native#text/plain
tests/webtbf/tw4111.pp svneol=native#text/plain
tests/webtbf/tw4139.pp svneol=native#text/plain

View File

@ -1941,8 +1941,10 @@ implementation
begin
sym:=tsym(classh.symtable.speedsearch(s,speedvalue));
if assigned(sym) and
Tsym(sym).is_visible_for_object(topclassh,current_procinfo.procdef._class) then
break;
tsym(sym).is_visible_for_object(topclassh,current_procinfo.procdef._class) then
break
else
sym:=nil;
classh:=classh.childof;
end;
searchsym_in_class:=sym;

View File

@ -479,7 +479,7 @@ implementation
end;
function Tsym.is_visible_for_object(currobjdef:Tdef;context : tdef):boolean;
function tsym.is_visible_for_object(currobjdef:Tdef;context : tdef):boolean;
begin
is_visible_for_object:=false;

17
tests/webtbf/tw3969.pp Normal file
View File

@ -0,0 +1,17 @@
{ %fail }
{$Mode Delphi}
{$R-,X+,V-}
uses crt, tw3969u;
var
myobj: testobj;
begin
clrscr;
myobj.init;
writeln(myobj.getvar);
myobj.setvar('antonio');
myobj.myvar := 'pippo';
writeln(myobj.myvar);
myobj.done;
end.

41
tests/webtbf/tw3969u.pp Normal file
View File

@ -0,0 +1,41 @@
{$Mode Delphi}
{$R-,X+,V-}
unit tw3969u;
interface
type testobj = object
constructor init;
destructor done;
procedure setvar(value: string);
function getvar: string;
private
myvar: string;
end;
implementation
constructor testobj.init;
begin
myvar := 'init';
end;
destructor testobj.done;
begin
myvar := 'done';
end;
procedure testobj.setvar;
begin
myvar := value;
end;
function testobj.getvar : string;
begin
result := myvar;
end;
end.