ソースを参照

+ allow local const symbols to override class members in delphi mode

git-svn-id: trunk@7793 -
florian 18 年 前
コミット
d50f869bbd
1 ファイル変更4 行追加1 行削除
  1. 4 1
      compiler/symtable.pas

+ 4 - 1
compiler/symtable.pas

@@ -1168,7 +1168,10 @@ implementation
         if not is_funcret_sym(sym) and
         if not is_funcret_sym(sym) and
            (defowner.typ=procdef) and
            (defowner.typ=procdef) and
            assigned(tprocdef(defowner)._class) and
            assigned(tprocdef(defowner)._class) and
-           (tprocdef(defowner).owner.defowner=tprocdef(defowner)._class) then
+           (tprocdef(defowner).owner.defowner=tprocdef(defowner)._class) and
+           { delphi allows local typed consts. having the same name as class members, probably
+             a delphi bug, but some delphi code depends on it }
+           not((m_duplicate_names in current_settings.modeswitches) and (sym.typ=staticvarsym)) then
           result:=tprocdef(defowner)._class.symtable.checkduplicate(hashedid,sym);
           result:=tprocdef(defowner)._class.symtable.checkduplicate(hashedid,sym);
       end;
       end;