Class: Yoda::Typing::Tree::MultipleAssignment

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

Instance Attribute Summary

Attributes inherited from Base

#context, #node

Instance Method Summary collapse

Methods inherited from Base

#build_child, #children, #generator, #initialize, #type

Constructor Details

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

Instance Method Details

#processObject



5
6
7
# File 'lib/yoda/typing/tree/multiple_assignment.rb', line 5

def process
  process_bind(node.children[0], node.children[1])
end

#process_bind(var, body_node) ⇒ Store::Types::Base

Parameters:

  • var (Symbol)
  • body_node (::AST::Node)

Returns:

  • (Store::Types::Base)


12
13
14
15
16
# File 'lib/yoda/typing/tree/multiple_assignment.rb', line 12

def process_bind(var, body_node)
  body_type = infer(body_node)
  context.environment.bind(var, body_type)
  body_type
end