In RubyMine I can write
# @param [Array<MyClass>] things
def foo(things)
end
and RubyMine will autocomplete MyClass methods for things.first.*
. However, when I loop through each, like:
# @param [Array<MyClass>] things
def foo(things)
things.each { |t| t.* }
end
RubyMine loses its type inference. I know I can add comments to specify block parameter types, but looping through an object of some type should only yield parameters of that type anyway.
Is there any way I can write a custom rule for RubyMine so that .each
, .map
, and other iterators are presumed to have the type of the variable its called upon?