diff --git a/.gitattributes b/.gitattributes index 85b6263ab8..f7c776e047 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/nobj.pas b/compiler/nobj.pas index 593b3bde38..d82cf2f7c6 100644 --- a/compiler/nobj.pas +++ b/compiler/nobj.pas @@ -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} diff --git a/tests/test/jvm/testall.bat b/tests/test/jvm/testall.bat index 283699b22f..ec11acbe31 100644 --- a/tests/test/jvm/testall.bat +++ b/tests/test/jvm/testall.bat @@ -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% diff --git a/tests/test/jvm/testall.sh b/tests/test/jvm/testall.sh index b553a7c1f9..19a78ae03d 100755 --- a/tests/test/jvm/testall.sh +++ b/tests/test/jvm/testall.sh @@ -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 + diff --git a/tests/test/jvm/tprop3.pp b/tests/test/jvm/tprop3.pp new file mode 100644 index 0000000000..cbb3488794 --- /dev/null +++ b/tests/test/jvm/tprop3.pp @@ -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.