Browse Source

* also allow overloading of function results with related interfaces

git-svn-id: trunk@2128 -
Jonas Maebe 19 years ago
parent
commit
f3e69a1569
1 changed files with 3 additions and 3 deletions
  1. 3 3
      compiler/nobj.pas

+ 3 - 3
compiler/nobj.pas

@@ -129,7 +129,7 @@ implementation
     uses
     uses
        strings,
        strings,
        globals,verbose,systems,
        globals,verbose,systems,
-       symtable,symconst,symtype,defcmp,
+       symtable,symconst,symtype,defcmp,defutil,
        dbgbase
        dbgbase
        ;
        ;
 
 
@@ -706,8 +706,8 @@ implementation
                                      if not(equal_defs(procdefcoll^.data.rettype.def,pd.rettype.def)) and
                                      if not(equal_defs(procdefcoll^.data.rettype.def,pd.rettype.def)) and
                                         not((procdefcoll^.data.rettype.def.deftype=objectdef) and
                                         not((procdefcoll^.data.rettype.def.deftype=objectdef) and
                                          (pd.rettype.def.deftype=objectdef) and
                                          (pd.rettype.def.deftype=objectdef) and
-                                         is_class(procdefcoll^.data.rettype.def) and
-                                         is_class(pd.rettype.def) and
+                                         is_class_or_interface(procdefcoll^.data.rettype.def) and
+                                         is_class_or_interface(pd.rettype.def) and
                                          (tobjectdef(pd.rettype.def).is_related(
                                          (tobjectdef(pd.rettype.def).is_related(
                                              tobjectdef(procdefcoll^.data.rettype.def)))) then
                                              tobjectdef(procdefcoll^.data.rettype.def)))) then
                                        Message2(parser_e_overridden_methods_not_same_ret,pd.fullprocname(false),
                                        Message2(parser_e_overridden_methods_not_same_ret,pd.fullprocname(false),