Actions
Bug #12501
closedAssignment to local variable itself doesn't occur an error
Bug #12501:
Assignment to local variable itself doesn't occur an error
Description
For example:
a = b # => undefined local variable or method `b' for main:Object (NameError)
but
a = a # => nil
a = a.merge({}) # => undefined method `merge' for nil:NilClass (NoMethodError)
The a
after =
is an undefined local variable, I think it should raise a NameError
, but it only returns a nil value.
Is this a feature or bug?
Actions