Project

General

Profile

Bug #6214

warnings on inspect for Enumerator objects if $VERBOSE

Added by no6v (Nobuhiro IMAI) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0dev (2012-03-28 trunk 35155) [x86_64-linux]
Backport:
[ruby-dev:45449]

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
#
$ ruby -ve 'p [].lazy'
ruby 2.0.0dev (2012-03-28 trunk 35155) [x86_64-linux]
-e:1: warning: instance variable arguments not initialized
#

xmpfilter を通す時に警告が表示されてちょっと困ります。

$ xmpfilter <(echo '[].lazy # =>')
[].lazy # => # # !> instance variable arguments not initialized


Files

no-warn-enum-inspect.patch (1.72 KB) no-warn-enum-inspect.patch no6v (Nobuhiro IMAI), 03/30/2012 10:50 PM

Associated revisions

Revision 63e8110b
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • enumerator.c (inspect_enumerator): suppress uninitialized instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 35218
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • enumerator.c (inspect_enumerator): suppress uninitialized instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI).

Revision 35218
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • enumerator.c (inspect_enumerator): suppress uninitialized instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI).

Revision 35218
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • enumerator.c (inspect_enumerator): suppress uninitialized instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI).

Revision 35218
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • enumerator.c (inspect_enumerator): suppress uninitialized instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI).

Revision 35218
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • enumerator.c (inspect_enumerator): suppress uninitialized instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI).

Revision 35218
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • enumerator.c (inspect_enumerator): suppress uninitialized instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI).

History

Updated by no6v (Nobuhiro IMAI) over 7 years ago

これらのインスタンス変数はスクリプト側からは見えないので、
警告は出なくてもよいのではないですかね。そういう方向で
パッチとテストを書いてみたので、見ていただけるとありがたいです。

#2

Updated by nobu (Nobuyoshi Nakada) over 7 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).

Also available in: Atom PDF