Type
# File typeprof-0.12.0/lib/typeprof/type.rb, line 462 def initialize(kind, idx, type_params, superclass, name) @kind = kind # :class | :module @idx = idx @type_params = type_params @superclass = superclass raise if @kind == :class && !@superclass @_name = name end
# File typeprof-0.12.0/lib/typeprof/type.rb, line 490 def consistent?(other) case other when Type::Class ty = self loop do # ad-hoc return false if !ty || !other # module return true if ty.idx == other.idx return false if ty.idx == 0 # Object ty = ty.superclass end when Type::Instance return true if other.klass == Type::Builtin[:obj] || other.klass == Type::Builtin[:class] || other.klass == Type::Builtin[:module] return false else false end end
# File typeprof-0.12.0/lib/typeprof/type.rb, line 474 def inspect if @_name "#{ @_name }@#{ @idx }" else "Class[#{ @idx }]" end end
# File typeprof-0.12.0/lib/typeprof/type.rb, line 486 def method_dispatch_info [self, true] end