From: ruby-core@... Date: 2015-04-28T00:27:59+00:00 Subject: [ruby-core:69008] [Ruby trunk - Bug #11103] [Rejected] Reassignment in if block that is not ran, causes variable to become nil Issue #11103 has been updated by Marc-Andre Lafortune. Status changed from Open to Rejected ---------------------------------------- Bug #11103: Reassignment in if block that is not ran, causes variable to become nil https://bugs.ruby-lang.org/issues/11103#change-52264 * Author: Sigurd Berg Svela * Status: Rejected * Priority: High * Assignee: * ruby -v: ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- I came across a situation where, when reassigning a variable, inside an if statement that is evaluated to false, causes the variable to become nil. I have included the code to reproduce the problem as a file. Changing the line
variable = [variable]to
@variable = [@variable]seems to work as a temporary workaround, but this still seems to me as a pretty weird bug. ---Files-------------------------------- ruby-bug.rb (649 Bytes) -- https://bugs.ruby-lang.org/