Object
 
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 15
def ==(other)
  other.is_a?(MethodType) &&
    other.type_params == type_params &&
    other.type == type &&
    other.block == block
end
             
             
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 84
def each_type(&block)
  if block
    type.each_type(&block)
    self.block&.yield_self do |b|
      b.type.each_type(&block)
    end
  else
    enum_for :each_type
  end
end
             
             
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 55
def free_variables(set = Set.new)
  type.free_variables(set)
  block&.type&.free_variables(set)
  set.subtract(type_param_names)
end
             
             
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 61
def map_type(&block)
  self.class.new(
    type_params: type_params,
    type: type.map_type(&block),
    block: self.block&.yield_self do |b|
      Types::Block.new(type: b.type.map_type(&block), required: b.required)
    end,
    location: location
  )
end
             
             
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 72
def map_type_bound(&block)
  if type_params.empty?
    self
  else
    self.update(
      type_params: type_params.map {|param|
        param.map_type(&block)
      }
    )
  end
end
             
             
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 31
def sub(s)
  sub = s.without(*type_param_names)
  self.class.new(
    type_params: type_params.map do |param|
      param.map_type do |bound|
        bound.map_type {|ty| ty.sub(sub) }
      end
    end,
    type: type.sub(sub),
    block: block&.sub(sub),
    location: location
  )
end
             
             
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 22
def to_json(state = _ = nil)
  {
    type_params: type_params,
    type: type,
    block: block,
    location: location
  }.to_json(state)
end
             
             
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 95
def to_s
  s = case
      when (b = block) && b.required
        "(#{type.param_to_s}) { (#{b.type.param_to_s}) -> #{b.type.return_to_s} } -> #{type.return_to_s}"
      when b = block
        "(#{type.param_to_s}) ?{ (#{b.type.param_to_s}) -> #{b.type.return_to_s} } -> #{type.return_to_s}"
      else
        "(#{type.param_to_s}) -> #{type.return_to_s}"
      end
  if type_params.empty?
    s
  else
    "[#{type_params.join(", ")}] #{s}"
  end
end
             
             
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 112
def type_param_names
  type_params.map(&:name)
end
             
             
               # File rbs-2.1.0/lib/rbs/method_type.rb, line 46
def update(type_params: self.type_params, type: self.type, block: self.block, location: self.location)
  self.class.new(
    type_params: type_params,
    type: type,
    block: block,
    location: location
  )
end