Project

General

Profile

This project is closed and read-only.

Actions

Bug #2362

closed

undefined variable has value?

Bug #2362: undefined variable has value?

Added by vo.x (Vit Ondruch) almost 17 years ago. Updated over 15 years ago.

Status:
Rejected
Assignee:
-
[ruby-core:26722]

Description

=begin
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 <main>': 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?
=end

Actions

Also available in: PDF Atom