Class: TypeProf::Core::SplatBox
- Defined in:
- lib/typeprof/core/graph/box.rb
Instance Attribute Summary collapse
-
#ary ⇒ Object
readonly
Returns the value of attribute ary.
-
#idx ⇒ Object
readonly
Returns the value of attribute idx.
-
#ret ⇒ Object
readonly
Returns the value of attribute ret.
Attributes inherited from Box
Instance Method Summary collapse
-
#initialize(node, genv, ary, idx) ⇒ SplatBox
constructor
A new instance of SplatBox.
- #run0(genv, changes) ⇒ Object
Methods inherited from Box
#destroy, #on_type_added, #on_type_removed, #reuse, #run, #to_s
Constructor Details
Instance Attribute Details
#ary ⇒ Object (readonly)
Returns the value of attribute ary.
342 343 344 |
# File 'lib/typeprof/core/graph/box.rb', line 342 def ary @ary end |
#idx ⇒ Object (readonly)
Returns the value of attribute idx.
342 343 344 |
# File 'lib/typeprof/core/graph/box.rb', line 342 def idx @idx end |
#ret ⇒ Object (readonly)
Returns the value of attribute ret.
342 343 344 |
# File 'lib/typeprof/core/graph/box.rb', line 342 def ret @ret end |
Instance Method Details
#run0(genv, changes) ⇒ Object
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/typeprof/core/graph/box.rb', line 344 def run0(genv, changes) @ary.each_type do |ty| case ty when Type::Instance if ty.mod == genv.mod_ary changes.add_edge(genv, ty.args[0], @ret) else "???" end when Type::Array if @idx && @idx < ty.elems.size changes.add_edge(genv, ty.elems[@idx], @ret) else changes.add_edge(genv, ty.get_elem(genv, @idx), @ret) end else "???" end end end |