Browse Source

* mark classes representing units as "final", since you're not supposed to
descend from them

git-svn-id: branches/jvmbackend@18446 -

Jonas Maebe 14 years ago
parent
commit
2514c4ddb1
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/agjasmin.pas

+ 3 - 2
compiler/agjasmin.pas

@@ -538,8 +538,9 @@ implementation
         if not assigned(obj) then
           begin
             { fake class type for unit -> name=unitname and
-              superclass=java.lang.object }
-            AsmWrite('.class public ');
+              superclass=java.lang.object, make final so you cannot descend
+              from it }
+            AsmWrite('.class final public ');
             if assigned(current_module.namespace) then
               AsmWrite(current_module.namespace^+'.');
             AsmWriteln(current_module.realmodulename^);