Cell, Array, and Hash are types for global interface, e.g., TypedISeq. Do not push such types to local environment, stack, etc.
# File typeprof-0.12.0/lib/typeprof/container-type.rb, line 37
def self.create_empty_instance(klass)
base_type = Type::Instance.new(klass)
case klass
when Type::Builtin[:ary] # XXX: check inheritance...
Type::Array.new(Type::Array::Elements.new([], Type.bot), base_type)
when Type::Builtin[:hash]
Type.gen_hash(base_type) {|h| }
else
Type::Cell.new(Type::Cell::Elements.new([Type.bot] * klass.type_params.size), base_type)
end
end
# File typeprof-0.12.0/lib/typeprof/container-type.rb, line 33
def consistent?(other)
raise "must not be used"
end
# File typeprof-0.12.0/lib/typeprof/container-type.rb, line 29
def each_free_type_variable(&blk)
@elems.each_free_type_variable(&blk)
end