Sha256: e14e8ba7d6c7ee98ec70547f76d0b7a8b614a5521ca39874b442552bd5390551

Contents?: true

Size: 475 Bytes

Versions: 2

Compression:

Stored size: 475 Bytes

Contents

module Yoda
  module Typing
    module Tree
      class VariableAssignment < Base
        def process
          process_bind(node.children[0], node.children[1])
        end

        # @param var [Symbol]
        # @param body_node [::AST::Node]
        # @return [Store::Types::Base]
        def process_bind(var, body_node)
          body_type = infer(body_node)
          context.environment.bind(var, body_type)
          body_type
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yoda-language-server-0.9.0 lib/yoda/typing/tree/variable_assignment.rb
yoda-language-server-0.8.0 lib/yoda/typing/tree/variable_assignment.rb