Class: TypeProf::Core::InstanceTypeBox

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

#add_symbol_proc_call_box, #destroy, #destroy_symbol_proc_call_boxes, #on_type_added, #on_type_removed, #reuse, #run, #to_s

Constructor Details

#initialize(node, genv, singleton_ty_vtx) ⇒ InstanceTypeBox

Returns a new instance of InstanceTypeBox.



1535
1536
1537
1538
1539
1540
# File 'lib/typeprof/core/graph/box.rb', line 1535

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

Instance Attribute Details

#retObject (readonly)

Returns the value of attribute ret.



1542
1543
1544
# File 'lib/typeprof/core/graph/box.rb', line 1542

def ret
  @ret
end

Instance Method Details

#run0(genv, changes) ⇒ Object



1544
1545
1546
1547
1548
1549
1550
1551
# File 'lib/typeprof/core/graph/box.rb', line 1544

def run0(genv, changes)
  instance_tys = []
  @singleton_ty_vtx.each_type do |ty|
    instance_tys << ty.get_instance_type(genv) if ty.is_a?(Type::Singleton)
  end
  source_vtx = Source.new(*instance_tys)
  changes.add_edge(genv, source_vtx, @ret)
end