Class: TypeProf::Core::SplatBox

Inherits:
Box
  • Object
show all
Defined in:
lib/typeprof/core/graph/box.rb

Instance Attribute Summary collapse

Attributes inherited from Box

#changes, #destroyed, #node

Instance Method Summary collapse

Methods inherited from Box

#destroy, #diagnostics, #on_type_added, #on_type_removed, #reuse, #run, #to_s

Constructor Details

#initialize(node, genv, ary) ⇒ SplatBox

Returns a new instance of SplatBox.



288
289
290
291
292
293
# File 'lib/typeprof/core/graph/box.rb', line 288

def initialize(node, genv, ary)
  super(node)
  @ary = ary
  @ary.add_edge(genv, self)
  @ret = Vertex.new(node)
end

Instance Attribute Details

#aryObject (readonly)

Returns the value of attribute ary.



295
296
297
# File 'lib/typeprof/core/graph/box.rb', line 295

def ary
  @ary
end

#retObject (readonly)

Returns the value of attribute ret.



295
296
297
# File 'lib/typeprof/core/graph/box.rb', line 295

def ret
  @ret
end

Instance Method Details

#run0(genv, changes) ⇒ Object



297
298
299
300
301
302
303
304
305
306
# File 'lib/typeprof/core/graph/box.rb', line 297

def run0(genv, changes)
  @ary.each_type do |ty|
    ty = ty.base_type(genv)
    if ty.mod == genv.mod_ary
      changes.add_edge(genv, ty.args[0], @ret)
    else
      "???"
    end
  end
end