Project

General

Profile

Bug #12501

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

For example: 

 ~~~ruby ~~~ 
 a = b # => undefined local variable or method `b' for main:Object (NameError) 
 ~~~ 

 but 

 ~~~ruby ~~~ 
 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?

Back