Переглянути джерело

* also search in parents for overloads when calling a constructor

peter 22 роки тому
батько
коміт
a57d25b3ed
1 змінених файлів з 10 додано та 6 видалено
  1. 10 6
      compiler/ncal.pas

+ 10 - 6
compiler/ncal.pas

@@ -160,7 +160,7 @@ interface
           procedure get_paratype;
           procedure get_paratype;
           procedure insert_typeconv(do_count : boolean);
           procedure insert_typeconv(do_count : boolean);
           procedure det_registers;
           procedure det_registers;
-          procedure firstcallparan(do_count : boolean);
+          procedure firstcallparan;
           procedure secondcallparan;virtual;abstract;
           procedure secondcallparan;virtual;abstract;
           function docompare(p: tnode): boolean; override;
           function docompare(p: tnode): boolean; override;
           procedure printnodetree(var t:text);override;
           procedure printnodetree(var t:text);override;
@@ -187,8 +187,8 @@ implementation
       symconst,paramgr,defutil,defcmp,
       symconst,paramgr,defutil,defcmp,
       htypechk,pass_1,
       htypechk,pass_1,
       ncnv,nld,ninl,nadd,ncon,nmem,
       ncnv,nld,ninl,nadd,ncon,nmem,
-      nutils,procinfo,
-      tgobj,cgbase
+      procinfo,
+      cgbase
       ;
       ;
 
 
 type
 type
@@ -782,7 +782,7 @@ type
       end;
       end;
 
 
 
 
-    procedure tcallparanode.firstcallparan(do_count : boolean);
+    procedure tcallparanode.firstcallparan;
       begin
       begin
         if not assigned(left.resulttype.def) then
         if not assigned(left.resulttype.def) then
           get_paratype;
           get_paratype;
@@ -1213,7 +1213,8 @@ type
           overloaded definitions in the class, this only needs to be done once
           overloaded definitions in the class, this only needs to be done once
           for class entries as the tree keeps always the same }
           for class entries as the tree keeps always the same }
         if (not symtableprocentry.overloadchecked) and
         if (not symtableprocentry.overloadchecked) and
-           (po_overload in symtableprocentry.first_procdef.procoptions) and
+           ((symtableprocentry.first_procdef.proctypeoption=potype_constructor) or
+            (po_overload in symtableprocentry.first_procdef.procoptions)) and
            (symtableprocentry.owner.symtabletype=objectsymtable) then
            (symtableprocentry.owner.symtabletype=objectsymtable) then
          search_class_overloads(symtableprocentry);
          search_class_overloads(symtableprocentry);
 
 
@@ -2570,7 +2571,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.196  2003-10-13 14:05:12  peter
+  Revision 1.197  2003-10-21 15:14:55  peter
+    * also search in parents for overloads when calling a constructor
+
+  Revision 1.196  2003/10/13 14:05:12  peter
     * removed is_visible_for_proc
     * removed is_visible_for_proc
     * search also for class overloads when finding interface
     * search also for class overloads when finding interface
       implementations
       implementations