/[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 41736 by julieng, Tue Jun 10 23:37:06 2003 UTC revision 41737 by manus, Fri Mar 5 18:56:29 2004 UTC
# Line 9  class Line 9  class
9  inherit  inherit
10          LIKE_TYPE_A          LIKE_TYPE_A
11                  redefine                  redefine
12                          is_basic, has_associated_class, is_like_current                          has_associated_class, is_like_current
13                  end                  end
14    
15  feature -- Properties  feature -- Properties
# Line 17  feature -- Properties Line 17  feature -- Properties
17          is_like_current: BOOLEAN is True          is_like_current: BOOLEAN is True
18                          -- Is the current type an anchored type on Current ?                          -- Is the current type an anchored type on Current ?
19    
         is_basic: BOOLEAN is  
                         -- Is the current actual type a basic one ?  
                 do  
                         Result := actual_type.is_basic  
                 end  
   
20  feature -- Access  feature -- Access
21    
22          same_as (other: TYPE_A): BOOLEAN is          same_as (other: TYPE_A): BOOLEAN is
# Line 82  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'.
79                    local
80                            l_int: MANIFEST_INTEGER_A
81                  do                  do
82                          create Result                          create Result
83                          Result.set_actual_type (type)                                  -- Special cases for calls on a target which is a manifest integer
84                                    -- that might be compatible with _8 or _16. The returned
85                                    -- `actual_type' should not take into consideration the
86                                    -- `compatibility_size' of `type', just its intrinsic type.
87                            l_int ?= type
88                            if l_int /= Void then
89                                            -- Because manifest integers are by default 32 bits, when
90                                            -- you apply a routine whose result is of type `like Current'
91                                            -- then it should really be a 32 bits integer. Note that in the
92                                            -- past we were keeping the size of the manifest integers and the
93                                            -- following code was accepted:
94                                            -- i16: INTEGER_16
95                                            -- i8: INTEGER_8
96                                            -- i16 := 0x00FF & i8
97                                            -- Now the code is rejected because target expect an INTEGER_16
98                                            -- and not an INTEGER, therefore the code needs to be fixed with:
99                                            -- i16 := (0x00FF).to_integer_16 & i8
100                                            -- or
101                                            -- i16 := (0x00FF & i8).to_integer_16
102                                    Result.set_actual_type (l_int.real_integer_type)
103                            else
104                                    Result.set_actual_type (type)
105                            end
106                  end                  end
107    
108          create_info: CREATE_CURRENT is          create_info: CREATE_CURRENT is

Legend:
Removed from v.41736  
changed lines
  Added in v.41737

  ViewVC Help
Powered by ViewVC 1.1.23