Browse Source

* mark unit-level routines as "final", since they can't be overridden

git-svn-id: branches/jvmbackend@18434 -
Jonas Maebe 14 years ago
parent
commit
20e55cd54e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/agjasmin.pas

+ 2 - 1
compiler/agjasmin.pas

@@ -677,7 +677,8 @@ implementation
           result:=result+'static ';
           result:=result+'static ';
         if is_javainterface(tdef(pd.owner.defowner)) then
         if is_javainterface(tdef(pd.owner.defowner)) then
           result:=result+'abstract ';
           result:=result+'abstract ';
-        if po_finalmethod in pd.procoptions then
+        if (pd.procsym.owner.symtabletype in [globalsymtable,staticsymtable,localsymtable]) or
+           (po_finalmethod in pd.procoptions) then
           result:=result+'final ';
           result:=result+'final ';
         result:=result+pd.jvmmangledbasename;
         result:=result+pd.jvmmangledbasename;
       end;
       end;