Bug #7588

New warnings on ||=

Added by Ryan Davis over 1 year ago. Updated over 1 year ago.

[ruby-core:50971]
Status:Closed
Priority:Normal
Assignee:-
Category:-
Target version:-
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 initializetest
self.multiruby
skip ||= []
self.testlib ||= :testunit
self.testprelude ||= 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 @multirubyskip 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 @rspecdirs 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 1 year ago

  • Status changed from Open to Feedback

Try with newer revision.

#2 Updated by Ryan Davis over 1 year ago

  • Status changed from Feedback to Closed

seems fixed. thanks

Also available in: Atom PDF