Hi,
In message "Re: [ ruby-Bugs-7680 ] a block argument within a block which argument has the same name leaks"
on Tue, 9 Jan 2007 10:34:53 +0900, dblack / wobblini.net writes:
|I wonder about this though:
|
|$ cat warntest.rb
|#!/usr/local/lib/ruby-matz/bin/ruby -vcw
|
|def x
| puts "hi"
|end
|
|[1,2,3].each {|x| puts x }
|
|x
|
|$ ./warntest.rb
|ruby 1.9.0 (2007-01-07 patchlevel 0) [i686-linux] - matz
|./warntest.rb:9: warning: out-of-scope variable - x
|Syntax OK
Well, it is difficult to warn it correctly. Don't tease the compiler. ;-)
It's not good manner anyway. It may be fixed in the future.
matz.