<div dir="ltr"><p class="">Doing some lazy instantiation and come across this oddity, maybe I'm just being dense.</p><p class=""><font face="courier new, monospace">$ irb</font></p>
<p class=""><font face="courier new, monospace">irb(main):001:0> def foo</font></p>
<p class=""><font face="courier new, monospace">irb(main):002:1> @bar ||= []</font></p>
<p class=""><font face="courier new, monospace">irb(main):003:1> end</font></p>
<p class=""><font face="courier new, monospace">=> :foo</font></p>
<p class=""><font face="courier new, monospace">irb(main):004:0> foo</font></p>
<p class=""><font face="courier new, monospace">=> []</font></p>
<p class=""><font face="courier new, monospace">irb(main):005:0> foo += []</font></p>
<p class=""><font face="courier new, monospace">NoMethodError: undefined method `+' for nil:NilClass</font></p>
<p class=""><font face="courier new, monospace"><span class=""> </span>from (irb):5</font></p>
<p class=""><font face="courier new, monospace"><span class=""> </span>from /Users/ken/.rbenv/versions/2.1.1/bin/irb:11:in `<main>'</font></p>
<p class=""><font face="courier new, monospace">irb(main):006:0> foo</font></p>
<p class=""><font face="courier new, monospace">=> nil</font></p></div>