Sha256: 7dccb7eca21a2ced8368038fb3948d41533d0e3ee7e72bcc6fa7bac3f0d0a877

Contents?: true

Size: 716 Bytes

Versions: 5

Compression:

Stored size: 716 Bytes

Contents

module Mirah
  module JVM
    module Types
      class PrimitiveType < Type
        def initialize(type, wrapper)
          @wrapper = wrapper
          super(type)
        end

        def primitive?
          true
        end

        def primitive_type
          @wrapper::TYPE
        end

        def newarray(method)
          method.send "new#{name}array"
        end

        def interfaces
          []
        end

        def convertible_to?(type)
          return true if type == self
          widening_conversions = WIDENING_CONVERSIONS[self]
          widening_conversions && widening_conversions.include?(type)
        end

        def superclass
          nil
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mirah-0.0.12-java lib/mirah/jvm/types/primitive_type.rb
mirah-0.0.11-java lib/mirah/jvm/types/primitive_type.rb
mirah-0.0.10-java lib/mirah/jvm/types/primitive_type.rb
mirah-0.0.9-java lib/mirah/jvm/types/primitive_type.rb
mirah-0.0.8-java lib/mirah/jvm/types/primitive_type.rb