Issue #7588 has been reported by zenspider (Ryan Davis).

----------------------------------------
Bug #7588: New warnings on ||=
https://bugs.ruby-lang.org/issues/7588

Author: zenspider (Ryan Davis)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: 2.0


I'm now getting warnings on my projects w/ 2.0 (ruby 2.0.0dev (2012-12-08 trunk 38265) [x86_64-darwin12.2.1]) when I use ||= to initialize unset variables. This never happened in < 2.0.

def initialize_test
  self.multiruby_skip ||= []
  self.testlib        ||= :testunit
  self.test_prelude   ||= nil
  self.rspec_dirs     ||= %w(spec lib)
  self.rspec_options  ||= []
end

begets:

/Users/ryan/Work/p4/zss/src/hoe/dev/lib/hoe/test.rb:59: warning: instance variable @multiruby_skip not initialized
/Users/ryan/Work/p4/zss/src/hoe/dev/lib/hoe/test.rb:60: warning: instance variable @testlib not initialized
/Users/ryan/Work/p4/zss/src/hoe/dev/lib/hoe/test.rb:61: warning: instance variable @test_prelude not initialized
/Users/ryan/Work/p4/zss/src/hoe/dev/lib/hoe/test.rb:62: warning: instance variable @rspec_dirs not initialized
/Users/ryan/Work/p4/zss/src/hoe/dev/lib/hoe/test.rb:63: warning: instance variable @rspec_options not initialized



-- 
http://bugs.ruby-lang.org/