浏览代码

* do not allow implementing interface methods using methods that are not
visible in the current class

git-svn-id: trunk@40645 -

Jonas Maebe 6 年之前
父节点
当前提交
9c6838ecca
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      compiler/nobj.pas

+ 3 - 1
compiler/nobj.pas

@@ -519,7 +519,9 @@ implementation
           begin
             srsym:=tsym(hclass.symtable.FindWithHash(hashedid));
             if assigned(srsym) and
-               (srsym.typ=procsym) then
+               (srsym.typ=procsym) and
+               ((hclass=_class) or
+                is_visible_for_object(srsym,_class)) then
               begin
                 for i:=0 to Tprocsym(srsym).ProcdefList.Count-1 do
                   begin