Bug #7244

ArgumentError of refine

Added by Kazuhiro NISHIYAMA over 1 year ago. Updated over 1 year ago.

[ruby-dev:46319]
Status:Closed
Priority:Normal
Assignee:Shugo Maeda
Category:core
Target version:2.0.0
ruby -v:ruby 2.0.0dev (2012-10-30 trunk 37389) [x86_64-linux] Backport:

Description

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 '
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
'
%

Associated revisions

Revision 37390
Added by Shugo Maeda over 1 year ago

  • eval.c (rbmodrefine): fix the error message when no block is
    given. [Bug #7244]

  • test/ruby/test_refinement.rb: related test.

History

#1 Updated by Shugo Maeda over 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r37390.
Kazuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • eval.c (rbmodrefine): fix the error message when no block is
    given. [Bug #7244]

  • test/ruby/test_refinement.rb: related test.

Also available in: Atom PDF