Bug #7588

New warnings on ||=

Added by Ryan Davis over 2 years ago. Updated over 2 years ago.

[ruby-core:50971]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:2.0 Backport:

Description

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

History

#1 Updated by Nobuyoshi Nakada over 2 years ago

  • Status changed from Open to Feedback

Try with newer revision.

#2 Updated by Ryan Davis over 2 years ago

  • Status changed from Feedback to Closed

seems fixed. thanks

Also available in: Atom PDF