Class: TypeProf::Core::MethodAliasBox
- Defined in:
- lib/typeprof/core/graph/box.rb
Instance Attribute Summary collapse
-
#cpath ⇒ Object
readonly
Returns the value of attribute cpath.
-
#new_mid ⇒ Object
readonly
Returns the value of attribute new_mid.
-
#node ⇒ Object
Returns the value of attribute node.
-
#old_mid ⇒ Object
readonly
Returns the value of attribute old_mid.
-
#ret ⇒ Object
readonly
Returns the value of attribute ret.
-
#singleton ⇒ Object
readonly
Returns the value of attribute singleton.
Attributes inherited from Box
Instance Method Summary collapse
- #destroy(genv) ⇒ Object
-
#initialize(node, genv, cpath, singleton, new_mid, old_mid) ⇒ MethodAliasBox
constructor
A new instance of MethodAliasBox.
- #run0(genv, changes) ⇒ Object
Methods inherited from Box
#diagnostics, #on_type_added, #on_type_removed, #reuse, #run, #to_s
Constructor Details
#initialize(node, genv, cpath, singleton, new_mid, old_mid) ⇒ MethodAliasBox
Returns a new instance of MethodAliasBox.
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
# File 'lib/typeprof/core/graph/box.rb', line 619 def initialize(node, genv, cpath, singleton, new_mid, old_mid) super(node) @cpath = cpath @singleton = singleton @new_mid = new_mid @old_mid = old_mid @ret = Source.new(genv.nil_type) me = genv.resolve_method(@cpath, @singleton, @new_mid) me.add_alias(self, @old_mid) if me.decls.empty? me.add_run_all_method_call_boxes(genv) else genv.add_run(self) end end |
Instance Attribute Details
#cpath ⇒ Object (readonly)
Returns the value of attribute cpath.
638 639 640 |
# File 'lib/typeprof/core/graph/box.rb', line 638 def cpath @cpath end |
#new_mid ⇒ Object (readonly)
Returns the value of attribute new_mid.
638 639 640 |
# File 'lib/typeprof/core/graph/box.rb', line 638 def new_mid @new_mid end |
#node ⇒ Object
Returns the value of attribute node.
636 637 638 |
# File 'lib/typeprof/core/graph/box.rb', line 636 def node @node end |
#old_mid ⇒ Object (readonly)
Returns the value of attribute old_mid.
638 639 640 |
# File 'lib/typeprof/core/graph/box.rb', line 638 def old_mid @old_mid end |
#ret ⇒ Object (readonly)
Returns the value of attribute ret.
638 639 640 |
# File 'lib/typeprof/core/graph/box.rb', line 638 def ret @ret end |
#singleton ⇒ Object (readonly)
Returns the value of attribute singleton.
638 639 640 |
# File 'lib/typeprof/core/graph/box.rb', line 638 def singleton @singleton end |
Instance Method Details
#destroy(genv) ⇒ Object
640 641 642 643 644 645 646 647 648 649 |
# File 'lib/typeprof/core/graph/box.rb', line 640 def destroy(genv) me = genv.resolve_method(@cpath, @singleton, @new_mid) me.remove_alias(self) if me.decls.empty? me.add_run_all_method_call_boxes(genv) else genv.add_run(self) end super(genv) end |
#run0(genv, changes) ⇒ Object
651 652 653 |
# File 'lib/typeprof/core/graph/box.rb', line 651 def run0(genv, changes) # TODO: what to do? end |