Bug #6214
closedwarnings on inspect for Enumerator objects if $VERBOSE
Description
Lazy なオブジェクトの inspect がわかりやすくなった反面、
$VERBOSE な時に警告が出るようです。
$ ruby -ve 'p "".bytes'
ruby 2.0.0dev (2012-03-28 trunk 35155) [x86_64-linux]
-e:1: warning: instance variable receiver not initialized
-e:1: warning: instance variable method not initialized
-e:1: warning: instance variable arguments not initialized
#<Enumerator: "":bytes>
$ ruby -ve 'p [].lazy'
ruby 2.0.0dev (2012-03-28 trunk 35155) [x86_64-linux]
-e:1: warning: instance variable arguments not initialized
#<Enumerator::Lazy: []>
xmpfilter を通す時に警告が表示されてちょっと困ります。
$ xmpfilter <(echo '[].lazy # =>')
[].lazy # => #<Enumerator::Lazy: []> # !> instance variable arguments not initialized
Files
Updated by no6v (Nobuhiro IMAI) over 12 years ago
これらのインスタンス変数はスクリプト側からは見えないので、
警告は出なくてもよいのではないですかね。そういう方向で
パッチとテストを書いてみたので、見ていただけるとありがたいです。
Updated by nobu (Nobuyoshi Nakada) over 12 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r35218.
Nobuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- enumerator.c (inspect_enumerator): suppress uninitialized
instance variable warnings. [ruby-dev:45449][Bug #6214]
patched by no6v (Nobuhiro IMAI).