Răsfoiți Sursa

* first check for overloaded operator before doing inserting any
typeconvs

peter 24 ani în urmă
părinte
comite
002118ddf4
1 a modificat fișierele cu 14 adăugiri și 10 ștergeri
  1. 14 10
      compiler/nadd.pas

+ 14 - 10
compiler/nadd.pas

@@ -115,6 +115,15 @@ implementation
             resulttypepass(right);
           end;
 
+         { allow operator overloading }
+         hp:=self;
+         if isbinaryoverloaded(hp) then
+           begin
+              resulttypepass(hp);
+              result:=hp;
+              exit;
+           end;
+
          { is one a real float, then both need to be floats, this
            need to be done before the constant folding so constant
            operation on a float and int are also handled }
@@ -443,15 +452,6 @@ implementation
               exit;
            end;
 
-         { allow operator overloading }
-         hp:=self;
-         if isbinaryoverloaded(hp) then
-           begin
-              resulttypepass(hp);
-              result:=hp;
-              exit;
-           end;
-
          { but an int/int gives real/real! }
          if nodetype=slashn then
           begin
@@ -1217,7 +1217,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.26  2001-05-19 12:53:52  peter
+  Revision 1.27  2001-05-19 21:11:50  peter
+    * first check for overloaded operator before doing inserting any
+      typeconvs
+
+  Revision 1.26  2001/05/19 12:53:52  peter
     * check set types when doing constant set evaluation
 
   Revision 1.25  2001/04/13 01:22:08  peter