* support anonymous procvar definitions for jvm outside parameter lists (in a

parameter list they represent nested procvars, which aren't supported yet)

git-svn-id: trunk@32454 -
This commit is contained in:
Jonas Maebe 2015-11-22 10:52:20 +00:00
parent 318b69600c
commit c4b347c271
5 changed files with 31 additions and 1 deletions

1
.gitattributes vendored
View File

@ -11566,6 +11566,7 @@ tests/test/jvm/tnestproc.pp svneol=native#text/plain
tests/test/jvm/topovl.pp svneol=native#text/plain
tests/test/jvm/toverload.pp svneol=native#text/plain
tests/test/jvm/toverload2.pp svneol=native#text/plain
tests/test/jvm/tprocvaranon.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

View File

@ -475,7 +475,10 @@ implementation
FpcBaseNestedProcVarType, pass nestedfpstruct to constructor and
copy it }
if name='' then
internalerror(2011071901);
begin
if is_nested_pd(tabstractprocdef(def)) then
internalerror(2011071901);
end;
setup_for_new_class('jvm_pvar_class',sstate,islocal,oldsymtablestack);

View File

@ -320,3 +320,7 @@ ppcjvm -O2 -g -B -CTinitlocals tformalclass
if %errorlevel% neq 0 exit /b %errorlevel%
java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. tformalclass
if %errorlevel% neq 0 exit /b %errorlevel%
ppcjvm -O2 -g -B -CTinitlocals tprocvaranon
if %errorlevel% neq 0 exit /b %errorlevel%
java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. tprocvaranon
if %errorlevel% neq 0 exit /b %errorlevel%

View File

@ -187,3 +187,5 @@ java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tsetstring
$PPC -O2 -g -B -Sa tnestcallpass1
$PPC -O2 -g -B -Sa tformalclass
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tformalclass
$PPC -O2 -g -B -Sa tprocvaranon
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tprocvaranon

View File

@ -0,0 +1,20 @@
program tprocvaranon;
type
tprocvaranonrec = record
p: function: longint;
end;
function test: longint;
begin
test:=123;
end;
var
r: tprocvaranonrec;
begin
r.p:=@test;
if r.p()<>123 then
halt(1);
end.