Class: Yoda::Typing::Tree::If
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#build_child, #children, #generator, #initialize
Constructor Details
This class inherits a constructor from Yoda::Typing::Tree::Base
Instance Method Details
#infer_branch_nodes(nodes) ⇒ Types::Base
11 12 13 |
# File 'lib/yoda/typing/tree/if.rb', line 11 def infer_branch_nodes(nodes) Types::Union.new(nodes.map { |node| infer(node) }) end |
#type ⇒ Object
5 6 7 |
# File 'lib/yoda/typing/tree/if.rb', line 5 def type infer_branch_nodes(node.children.slice(1..2).compact) end |