Browse Source

* make compatible_childmethod_resultdef() also work for Java classes
(so that you can override a method in a child class with one that
returns a descendent of the original return type -- since the JVM
will always select the version with the most specific return type,
that even corresponds perfectly to standard JVM behaviour)

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

Jonas Maebe 14 years ago
parent
commit
f20e206849
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/defcmp.pas

+ 2 - 2
compiler/defcmp.pas

@@ -1908,8 +1908,8 @@ implementation
           (equal_defs(parentretdef,childretdef)) or
           (equal_defs(parentretdef,childretdef)) or
           ((parentretdef.typ=objectdef) and
           ((parentretdef.typ=objectdef) and
            (childretdef.typ=objectdef) and
            (childretdef.typ=objectdef) and
-           is_class_or_interface_or_objc(parentretdef) and
-           is_class_or_interface_or_objc(childretdef) and
+           is_class_or_interface_or_objc_or_java(parentretdef) and
+           is_class_or_interface_or_objc_or_java(childretdef) and
            (tobjectdef(childretdef).is_related(tobjectdef(parentretdef))))
            (tobjectdef(childretdef).is_related(tobjectdef(parentretdef))))
       end;
       end;