/[eiffelstudio]/branches/eth/eve/Src/Eiffel/API/evaluated_type/like_current.e
ViewVC logotype

Diff of /branches/eth/eve/Src/Eiffel/API/evaluated_type/like_current.e

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 49679 by manus, Fri Mar 5 18:56:29 2004 UTC revision 49680 by alexk, Thu Mar 31 15:29:08 2005 UTC
# Line 76  feature {COMPILER_EXPORTER} -- Primitive Line 76  feature {COMPILER_EXPORTER} -- Primitive
76          instantiation_in (type: TYPE_A; written_id: INTEGER): LIKE_CURRENT is          instantiation_in (type: TYPE_A; written_id: INTEGER): LIKE_CURRENT is
77                          -- Instantiation of Current in the context of `class_type',                          -- Instantiation of Current in the context of `class_type',
78                          -- assuming that Current is written in class of id `written_id'.                          -- assuming that Current is written in class of id `written_id'.
                 local  
                         l_int: MANIFEST_INTEGER_A  
79                  do                  do
80                          create Result                          create Result
81                                  -- Special cases for calls on a target which is a manifest integer                                  -- Special cases for calls on a target which is a manifest integer
82                                  -- that might be compatible with _8 or _16. The returned                                  -- that might be compatible with _8 or _16. The returned
83                                  -- `actual_type' should not take into consideration the                                  -- `actual_type' should not take into consideration the
84                                  -- `compatibility_size' of `type', just its intrinsic type.                                  -- `compatibility_size' of `type', just its intrinsic type.
85                          l_int ?= type                                  -- Because manifest integers are by default 32 bits, when
86                          if l_int /= Void then                                  -- you apply a routine whose result is of type `like Current'
87                                          -- Because manifest integers are by default 32 bits, when                                  -- then it should really be a 32 bits integer. Note that in the
88                                          -- you apply a routine whose result is of type `like Current'                                  -- past we were keeping the size of the manifest integers and the
89                                          -- then it should really be a 32 bits integer. Note that in the                                  -- following code was accepted:
90                                          -- past we were keeping the size of the manifest integers and the                                  -- i16: INTEGER_16
91                                          -- following code was accepted:                                  -- i8: INTEGER_8
92                                          -- i16: INTEGER_16                                  -- i16 := 0x00FF & i8
93                                          -- i8: INTEGER_8                                  -- Now the code is rejected because target expect an INTEGER_16
94                                          -- i16 := 0x00FF & i8                                  -- and not an INTEGER, therefore the code needs to be fixed with:
95                                          -- Now the code is rejected because target expect an INTEGER_16                                  -- i16 := (0x00FF).to_integer_16 & i8
96                                          -- and not an INTEGER, therefore the code needs to be fixed with:                                  -- or
97                                          -- i16 := (0x00FF).to_integer_16 & i8                                  -- i16 := (0x00FF & i8).to_integer_16
98                                          -- or                          Result.set_actual_type (type.intrinsic_type)
                                         -- i16 := (0x00FF & i8).to_integer_16  
                                 Result.set_actual_type (l_int.real_integer_type)  
                         else  
                                 Result.set_actual_type (type)  
                         end  
99                  end                  end
100    
101          create_info: CREATE_CURRENT is          create_info: CREATE_CURRENT is

Legend:
Removed from v.49679  
changed lines
  Added in v.49680

  ViewVC Help
Powered by ViewVC 1.1.23