* inherit po_auto_raised_visibility flag when the visibility of a method is

raised because it was automatically raised in the parent class (can happen
    for the JVM target when letting the compiler generate getters/setters for
    properties)

git-svn-id: trunk@23522 -
This commit is contained in:
Jonas Maebe 2013-01-26 16:52:28 +00:00
parent d762ef9e78
commit e7315d035c
5 changed files with 46 additions and 1 deletions

1
.gitattributes vendored
View File

@ -10408,6 +10408,7 @@ tests/test/jvm/tnestproc.pp svneol=native#text/plain
tests/test/jvm/topovl.pp svneol=native#text/plain
tests/test/jvm/tprop.pp svneol=native#text/plain
tests/test/jvm/tprop2.pp svneol=native#text/plain
tests/test/jvm/tprop3.pp svneol=native#text/plain
tests/test/jvm/tpvar.pp svneol=native#text/plain
tests/test/jvm/tpvardelphi.pp svneol=native#text/plain
tests/test/jvm/tpvarglobal.pp svneol=native#text/plain

View File

@ -429,7 +429,11 @@ implementation
if po_auto_raised_visibility in vmtpd.procoptions then
begin
if updatevalues then
pd.visibility:=vmtentryvis;
begin
pd.visibility:=vmtentryvis;
{ this one's visibility is now also auto-raised }
include(pd.procoptions,po_auto_raised_visibility);
end
end
else
{$ifdef jvm}

View File

@ -252,3 +252,5 @@ ppcjvm -O2 -g -B ttincdec.pp
if %errorlevel% neq 0 exit /b %errorlevel%
java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. -Sa ttincdec
if %errorlevel% neq 0 exit /b %errorlevel%
ppcjvm -O2 -g -B -CTautogetterprefix=Get tprop3.pp
if %errorlevel% neq 0 exit /b %errorlevel%

View File

@ -141,3 +141,5 @@ $PPC -O2 -g -B -Sa tw22807
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tw22807
$PPC -O2 -g -B -Sa ttincdec.pp
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. ttincdec
$PPC -O2 -g -B -CTautogetterprefix=Get tprop3

36
tests/test/jvm/tprop3.pp Normal file
View File

@ -0,0 +1,36 @@
program tprop3;
{$mode delphi}
type
tprop3c = class
protected
function Gettest: longint; virtual; abstract;
public
property test: longint read Gettest;
end;
tprop3c2 = class(tprop3c)
protected
function Gettest: longint; override;
end;
tprop3c3 = class(tprop3c2)
protected
function Gettest: longint; override;
end;
function tprop3c2.Gettest: longint;
begin
result:=1;
end;
function tprop3c3.Gettest: longint;
begin
result:=2;
end;
begin
end.