Browse Source

* only change the visibility of an existing getter/setter to that of
its property in case the visibility of the property is higher than
that of the getter/setter (on the JVM target when automatically
generating getters/setters)

git-svn-id: trunk@23523 -

Jonas Maebe 12 years ago
parent
commit
2ed4b295fe
1 changed files with 5 additions and 2 deletions
  1. 5 2
      compiler/jvm/pjvm.pas

+ 5 - 2
compiler/jvm/pjvm.pas

@@ -932,8 +932,11 @@ implementation
                         parentpd:=tprocdef(tprocsym(sym).procdeflist[0]);
                       if parentpd.owner.defowner=p.owner.defowner then
                         begin
-                          parentpd.visibility:=p.visibility;
-                          include(parentpd.procoptions,po_auto_raised_visibility);
+                          if parentpd.visibility<p.visibility then
+                            begin
+                              parentpd.visibility:=p.visibility;
+                              include(parentpd.procoptions,po_auto_raised_visibility);
+                            end;
                           { we are done, no need to create a wrapper }
                           exit
                         end