Issue #1303 has been updated by Charles Nutter.


I agree with Shyouhei. There are many such cases where a variable may not yet have been assigned, but for consistency all future references should treat it as a variable.

Would you expect f to refer to the method or the variable after the if statement here:

  def f; 123; end
  if false; f = nil; end
  f

Having a clear lifecycle for local variables that does not depend on what actually runs or doesn't run (or when it runs) is very important for both readability and performance. From the moment you see a direct assignment to f, it's a local variable from then on.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1303

----------------------------------------
http://redmine.ruby-lang.org