RubyMine - automatically detect .each, .map, and other iterator types
<p>In RubyMine I can write</p>

<pre><code># @param [Array&lt;MyClass&gt;] things
def foo(things)
end
</code></pre>

<p>and RubyMine will autocomplete MyClass methods for <code>things.first.*</code>. However, when I loop through each, like:</p>

<pre><code># @param [Array&lt;MyClass&gt;] things
def foo(things)
    things.each { |t| t.* }
end
</code></pre>

<p>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.</p>

<p><strong>Is there any way I can write a custom rule for RubyMine so that <code>.each</code>, <code>.map</code>, and other iterators are presumed to have the type of the variable its called upon?</strong></p>