Browse Source

* don't generate incompatible types when there is an errordef

peter 21 years ago
parent
commit
6245066670
1 changed files with 8 additions and 6 deletions
  1. 8 6
      compiler/symtable.pas

+ 8 - 6
compiler/symtable.pas

@@ -1747,6 +1747,9 @@ implementation
       var
       var
         s1,s2 : string;
         s1,s2 : string;
       begin
       begin
+        if (def2.deftype=errordef) or
+           (def1.deftype=errordef) then
+          exit;
         s1:=def1.typename;
         s1:=def1.typename;
         s2:=def2.typename;
         s2:=def2.typename;
         { When the names are the same try to include the unit name }
         { When the names are the same try to include the unit name }
@@ -1757,8 +1760,7 @@ implementation
             if (def2.owner.symtabletype in [globalsymtable,staticsymtable]) then
             if (def2.owner.symtabletype in [globalsymtable,staticsymtable]) then
               s2:=def2.owner.realname^+'.'+s2;
               s2:=def2.owner.realname^+'.'+s2;
           end;
           end;
-        if def2.deftype<>errordef then
-          CGMessage2(type_e_incompatible_types,s1,s2);
+        CGMessage2(type_e_incompatible_types,s1,s2);
       end;
       end;
 
 
 
 
@@ -2283,8 +2285,6 @@ implementation
         globaltypecount:=1;
         globaltypecount:=1;
         pglobaltypecount:=@globaltypecount;
         pglobaltypecount:=@globaltypecount;
 {$endif GDB}
 {$endif GDB}
-        { defs for internal use }
-        voidprocdef:=tprocdef.create(unknown_level);
         { create error syms and def }
         { create error syms and def }
         generrorsym:=terrorsym.create;
         generrorsym:=terrorsym.create;
         generrortype.setdef(terrordef.create);
         generrortype.setdef(terrordef.create);
@@ -2297,7 +2297,6 @@ implementation
 
 
    procedure DoneSymtable;
    procedure DoneSymtable;
       begin
       begin
-        voidprocdef.free;
         generrorsym.free;
         generrorsym.free;
         generrortype.def.free;
         generrortype.def.free;
 {$ifdef UNITALIASES}
 {$ifdef UNITALIASES}
@@ -2308,7 +2307,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.146  2004-05-22 23:34:28  peter
+  Revision 1.147  2004-05-23 20:56:14  peter
+    * don't generate incompatible types when there is an errordef
+
+  Revision 1.146  2004/05/22 23:34:28  peter
   tai_regalloc.allocation changed to ratype to notify rgobj of register size changes
   tai_regalloc.allocation changed to ratype to notify rgobj of register size changes
 
 
   Revision 1.145  2004/04/29 19:56:37  daniel
   Revision 1.145  2004/04/29 19:56:37  daniel