class Solargraph::Source::Chain

def define api_map, name_pin, locals

Returns:
  • (::Array) - Pins representing possible return

Parameters:
  • locals (::Enumerable) -- Any local
  • name_pin (Pin::Closure) -- the surrounding closure pin for
  • api_map (ApiMap) --
def define api_map, name_pin, locals
  return [] if undefined?
  # working_pin is the surrounding closure pin for the link

  # being processed, whose #binder method will provide the LHS /

  # 'self type' of the next link (same as the  #return_type method

  # --the type of the result so far).

  #

  # @todo ProxyType uses 'type' for the binder, but '

  working_pin = name_pin
  links[0..-2].each do |link|
    pins = link.resolve(api_map, working_pin, locals)
    type = infer_first_defined(pins, working_pin, api_map, locals)
    return [] if type.undefined?
    working_pin = Pin::ProxyType.anonymous(type)
  end
  links.last.last_context = working_pin
  links.last.resolve(api_map, working_pin, locals)
end