Actions
Feature #11534
closedCircular assignment / method shadowing unexpected behavior
Status:
Rejected
Assignee:
-
Target version:
-
Description
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)
Updated by nobu (Nobuyoshi Nakada) over 8 years ago
- Description updated (diff)
- Status changed from Open to Rejected
Assignment statements make variables.
Updated by tsmith (Tim Smith) over 8 years ago
- Tracker changed from Bug to Feature
Then consider it a feature request ;) First evaluate the righthand side, then make the variable.
Actions
Like0
Like0Like0