mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 06:29:25 +01:00
* mark classes representing records as final
* mark sealed classes as final * mark "final" fields as final git-svn-id: branches/jvmbackend@18609 -
This commit is contained in:
parent
0f15664ffa
commit
52b62732e2
@ -555,7 +555,8 @@ implementation
|
||||
case obj.typ of
|
||||
recorddef:
|
||||
begin
|
||||
AsmWrite('.class ');
|
||||
{ can't inherit from records }
|
||||
AsmWrite('.class final ');
|
||||
if toplevelowner.symtabletype=globalsymtable then
|
||||
AsmWrite('public ');
|
||||
AsmWriteln(obj.jvm_full_typename(true));
|
||||
@ -567,6 +568,8 @@ implementation
|
||||
odt_javaclass:
|
||||
begin
|
||||
AsmWrite('.class ');
|
||||
if oo_is_sealed in tobjectdef(obj).objectoptions then
|
||||
AsmWrite('final ');
|
||||
if toplevelowner.symtabletype=globalsymtable then
|
||||
AsmWrite('public ');
|
||||
AsmWriteln(obj.jvm_full_typename(true));
|
||||
@ -821,7 +824,7 @@ implementation
|
||||
if (sym.typ=staticvarsym) or
|
||||
(sp_static in sym.symoptions) then
|
||||
result:=result+'static ';
|
||||
if sym.varspez=vs_const then
|
||||
if sym.varspez in [vs_const,vs_final] then
|
||||
result:=result+'final ';
|
||||
result:=result+jvmmangledbasename(sym,true);
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user