Răsfoiți Sursa

* Consider conversion from integer to integer te_equal, if the base types
are equal and the range of the from type fits in the to type. I.e.
conversion from -10..10 to shortint is considered equal. This is correct
because in this case, the from type can be used wherever the to type is
used, i.e. the compiler never needs to do conversion at compile or run
time.

git-svn-id: trunk@7814 -

daniel 18 ani în urmă
părinte
comite
504d845e86
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      compiler/defcmp.pas

+ 2 - 2
compiler/defcmp.pas

@@ -225,8 +225,8 @@ implementation
                           u8bit,u16bit,u32bit,u64bit,
                           s8bit,s16bit,s32bit,s64bit:
                             begin
-                              if (torddef(def_from).low=torddef(def_to).low) and
-                                 (torddef(def_from).high=torddef(def_to).high) then
+                              if (torddef(def_from).low>=torddef(def_to).low) and
+                                 (torddef(def_from).high<=torddef(def_to).high) then
                                 eq:=te_equal
                               else
                                 begin