Class: Yoda::Typing::Tree::BlockCall

Inherits:
Base
  • Object
show all
Includes:
SendInferable
Defined in:
lib/yoda/typing/tree/block_call.rb

Instance Attribute Summary

Attributes inherited from Base

#context, #tracer

Instance Method Summary collapse

Methods inherited from Base

#build_child, #generator, #infer_child, #initialize, #inspect, #pretty_print, #type

Constructor Details

This class inherits a constructor from Yoda::Typing::Tree::Base

Instance Method Details

#infer_typeTypes::Type

Returns:



13
14
15
16
17
18
19
20
21
22
# File 'lib/yoda/typing/tree/block_call.rb', line 13

def infer_type
  if node.send_clause.type == :send
    infer_send(node.send_clause, node.parameters, node.body)
  else
    # super or zsuper
    child_type = infer_child(node.send_clause)
    infer_child(node.body)
    child_type
  end
end

#nodeAST::BlockCallNode

Returns:



# File 'lib/yoda/typing/tree/block_call.rb', line 9