Browse Source

* inherited; works now in delphi mode for private methods; looks like a delphi bug

florian 20 years ago
parent
commit
5007b3e395
2 changed files with 18 additions and 7 deletions
  1. 11 5
      compiler/htypechk.pas
  2. 7 2
      compiler/ncal.pas

+ 11 - 5
compiler/htypechk.pas

@@ -66,7 +66,7 @@ interface
         FAllowVariant : boolean;
         function proc_add(pd:tprocdef):pcandidate;
       public
-        constructor create(sym:tprocsym;st:tsymtable;ppn:tnode;isprop:boolean);
+        constructor create(sym:tprocsym;st:tsymtable;ppn:tnode;isprop,ignorevis : boolean);
         constructor create_operator(op:ttoken;ppn:tnode);
         destructor destroy;override;
         procedure list(all:boolean);
@@ -1313,7 +1313,7 @@ implementation
                            TCallCandidates
 ****************************************************************************}
 
-    constructor tcallcandidates.create(sym:tprocsym;st:tsymtable;ppn:tnode;isprop:boolean);
+    constructor tcallcandidates.create(sym:tprocsym;st:tsymtable;ppn:tnode;isprop,ignorevis : boolean);
       var
         j          : integer;
         pd         : tprocdef;
@@ -1377,8 +1377,11 @@ implementation
             { Is the procdef visible? This needs to be checked on
               procdef level since a symbol can contain both private and
               public declarations. But the check should not be done
-              when the callnode is generated by a property }
-            if isprop or
+              when the callnode is generated by a property
+
+              inherited overrides invisible anonymous inherited (FK) }
+
+            if isprop or ignorevis or
                (pd.owner.symtabletype<>objectsymtable) or
                pd.is_visible_for_object(topclassh) then
              begin
@@ -2017,7 +2020,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.112  2005-01-25 18:49:45  peter
+  Revision 1.113  2005-02-01 22:50:50  florian
+    * inherited; works now in delphi mode for private methods; looks like a delphi bug
+
+  Revision 1.112  2005/01/25 18:49:45  peter
     * fix overload choosing with an qword overload
     * allow to get the address of string temps in delphi mode
 

+ 7 - 2
compiler/ncal.pas

@@ -1582,7 +1582,9 @@ type
               { do we know the procedure to call ? }
               if not(assigned(procdefinition)) then
                 begin
-                   candidates:=tcallcandidates.create(symtableprocentry,symtableproc,left,(nf_isproperty in flags));
+                   candidates:=tcallcandidates.create(symtableprocentry,symtableproc,left,(nf_isproperty in flags),
+                     { ignore possible private in delphi mode for anon. inherited (FK) }
+                     (m_delphi in aktmodeswitches) and (cnf_anon_inherited in callnodeflags));
 
                    { no procedures found? then there is something wrong
                      with the parameter size or the procedures are
@@ -2496,7 +2498,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.276  2005-01-19 22:19:41  peter
+  Revision 1.277  2005-02-01 22:50:50  florian
+    * inherited; works now in delphi mode for private methods; looks like a delphi bug
+
+  Revision 1.276  2005/01/19 22:19:41  peter
     * unit mapping rewrite
     * new derefmap added