Issue #11534 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Rejected

Assignment statements make variables.

----------------------------------------
Bug #11534: Circular assignment / method shadowing unexpected behavior
https://bugs.ruby-lang.org/issues/11534#change-54209

* Author: Tim Smith
* Status: Rejected
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
~~~ruby
def foo
  1
end

puts foo + 1

bar = foo + 1
puts bar

foo = foo + 1
puts foo
~~~

~~~
# EXPECTED
2
2
2
~~~
~~~
# ACTUAL
2
2
undefined method `+' for nil:NilClass (NoMethodError)



-- 
https://bugs.ruby-lang.org/