[
'__ENCODING__', '__LINE__', '__FILE__', 'BEGIN', 'END', 'alias', 'and',
'begin', 'break', 'case', 'class', 'def', 'defined?', 'do', 'else',
'elsif', 'end', 'ensure', 'false', 'for', 'if', 'in', 'module', 'next',
'nil', 'not', 'or', 'redo', 'rescue', 'retry', 'return', 'self', 'super',
'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'
].map { |k| Pin::Keyword.new(k) }
[
Override.method_return('Array#concat', 'Array'),
Override.method_return('Array#keep_if', 'self'),
Override.method_return('Array#delete_if', 'self'),
Override.('Array#map', %(
@overload map(&block)
@return [Array]
@overload map()
@return [Enumerator]
)),
Override.('Array#reject', %(
@overload reject(&block)
@return [self]
@overload reject()
@return [Enumerator]
)),
Override.method_return('Array#reverse', 'self', delete: ['overload']),
Override.('Array#select', %(
@overload select(&block)
@return [self]
@overload select()
@return [Enumerator]
)),
Override.('Array#[]', %(
@overload [](range)
@param range [Range]
@return [self]
@overload [](num1, num2)
@param num1 [Integer]
@param num2 [Integer]
@return [self]
@overload [](num)
@param num [Integer]
@return_single_parameter
@return_single_parameter
)),
Override.('Array#first', %(
@overload first(num)
@param num [Integer]
@return [self]
@return_single_parameter
)),
Override.('Array#last', %(
@overload last(num)
@param num [Integer]
@return [self]
@return_single_parameter
)),
Override.method_return('Array#map', 'Array'),
Override.method_return('Array#uniq', 'self'),
Override.method_return('Array#zip', 'Array, nil'),
Override.('BasicObject#==', %(
@param other [BasicObject]
@return [Boolean]
)),
Override.method_return('BasicObject#initialize', 'void'),
Override.method_return('Class#new', 'self'),
Override.method_return('Class.new', 'Class<Object>'),
Override.method_return('Class#allocate', 'self'),
Override.method_return('Class.allocate', 'Class<Object>'),
Override.method_return('Enumerable#select', 'self'),
Override.method_return('File.absolute_path', 'String'),
Override.method_return('File.basename', 'String'),
Override.method_return('File.dirname', 'String'),
Override.method_return('File.extname', 'String'),
Override.method_return('File.join', 'String'),
Override.('Float#+', %(
@param y [Numeric]
@return [Numeric]
)),
Override.('Hash#[]', %(
@return_value_parameter
)),
Override.('Hash#[]=', %(
@param_tuple
)),
Override.method_return('Hash#merge', 'Hash'),
Override.('Integer#+', %(
@param y [Numeric]
@return [Numeric]
)),
Override.method_return('Kernel#puts', 'nil'),
Override.('Numeric#+', %(
@param y [Numeric]
@return [Numeric]
)),
Override.method_return('Object#!', 'Boolean'),
Override.method_return('Object#clone', 'self', delete: [:overload]),
Override.method_return('Object#dup', 'self', delete: [:overload]),
Override.method_return('Object#freeze', 'self', delete: [:overload]),
Override.method_return('Object#inspect', 'String'),
Override.method_return('Object#taint', 'self'),
Override.method_return('Object#to_s', 'String'),
Override.method_return('Object#untaint', 'self'),
Override.('Object#tap', %(
@return [self]
@yieldparam [self]
)),
Override.('STDERR', %(
@type [IO]
)),
Override.('STDIN', %(
@type [IO]
)),
Override.('STDOUT', %(
@type [IO]
)),
Override.method_return('String#freeze', 'self'),
Override.method_return('String#split', 'Array<String>'),
Override.method_return('String#lines', 'Array<String>'),
Override.('String#each_line', %(
@yieldparam [String]
)),
Override.('String.new', %(
@overload new(*)
@return [self]
))
].concat(
methods_with_yieldparam_subtypes.map do |path|
Override.(path, %(
@yieldparam_single_parameter
))
end
)