Forum: Ruby-dev [ruby-trunk - Bug #7244][Open] ArgumentError of refine

C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 znz (Kazuhiro NISHIYAMA) (Guest)
on 2012-10-30 14:03
(Received via mailing list)
Issue #7244 has been reported by znz (Kazuhiro NISHIYAMA).

----------------------------------------
Bug #7244: ArgumentError of refine
https://bugs.ruby-lang.org/issues/7244

Author: znz (Kazuhiro NISHIYAMA)
Status: Open
Priority: Normal
Assignee: shugo (Shugo Maeda)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-10-30 trunk 37389) [x86_64-linux]


refine は 1 個しか引数をとらないはずなのにブロックを渡さずに引数 1 個で呼び出すと (0 for 1..3) という
ArgumentError になります。

% ruby -v
ruby 2.0.0dev (2012-10-30 trunk 37389) [x86_64-linux]
% ruby -e 'Class.new{|c|refine}'
-e:1:in `refine': wrong number of arguments (0 for 1) (ArgumentError)
        from -e:1:in `block in <main>'
        from -e:1:in `initialize'
        from -e:1:in `new'
        from -e:1:in `<main>'
% ruby -e 'Class.new{|c|refine c}'
-e:1:in `refine': wrong number of arguments (0 for 1..3) (ArgumentError)
        from -e:1:in `block in <main>'
        from -e:1:in `initialize'
        from -e:1:in `new'
        from -e:1:in `<main>'
%
This topic is locked and can not be replied to.