module Carbon::Core::Integer::Type
Defines the integer types. This uses the {Core::Ints} list to determine the integer types that will be defined, and defines them with the `:internal` type. This defines the following integer types:
-
`Carbon::Int8`, `Carbon::UInt8`
-
`Carbon::Int16`, `Carbon::UInt16`
-
`Carbon::Int32`, `Carbon::UInt32`
-
`Carbon::Int64`, `Carbon::UInt64`
@api private
Public Instance Methods
define_integer_type(int)
click to toggle source
Defines the integer type for the given integer information. All integers implement both the `Carbon::Sized` and `Carbon::Numeric` traits.
@param int [Core::Int] The integer type. @return [void]
# File lib/carbon/core/integer/type.rb, line 31 def define_integer_type(int) Core.define(internal: int.name) do |internal| internal[:kind] = :integer internal[:size] = int.size internal[:implements] << Carbon::Type("Carbon::Sized") internal[:implements] << Carbon::Type("Carbon::Numeric") end end
define_integer_types()
click to toggle source
Defines all of the integer types.
@return [void]
# File lib/carbon/core/integer/type.rb, line 21 def define_integer_types Ints.each { |int| define_integer_type(int) } end