From: Vit Ondruch Date: 2009-11-13T22:05:19+09:00 Subject: [ruby-core:26722] [Bug #2362] undefined variable has value? Bug #2362: undefined variable has value? http://redmine.ruby-lang.org/issues/show/2362 Author: Vit Ondruch Status: Open, Priority: Normal Category: core ruby -v: ruby 1.9.2dev (2009-10-15) [i386-mswin32_90] C:\>type test.rb if false a = 5 else end c = a d = b C:\>c:\ruby\bin\ruby.exe test.rb test.rb:7:in `
': undefined local variable or method `b' for main:Object (NameError) From my point of view, the variable "a" was never reached. How that can be that it is later defined with nil value? ---------------------------------------- http://redmine.ruby-lang.org