浏览代码

Merged revisions 2128 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

r2128 (jonas)
* also allow overloading of function results with related interfaces

git-svn-id: branches/fixes_2_0@2129 -

Jonas Maebe 20 年之前
父节点
当前提交
aff271bb2b
共有 1 个文件被更改,包括 3 次插入3 次删除
  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
 {$ifdef GDB}
 {$ifdef GDB}
        ,gdb
        ,gdb
 {$endif GDB}
 {$endif GDB}
@@ -708,8 +708,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),