mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vm_insnhelper.c: improved error message for "wrong number
of arguments", distinguishing given and expected argument numbers clearly. [Feature #9025] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
05b18ac1e6
commit
927e18b370
2 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Oct 24 12:47:47 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||
|
||||
* vm_insnhelper.c: improved error message for "wrong number
|
||||
of arguments", distinguishing given and expected argument
|
||||
numbers clearly. [Feature #9025]
|
||||
|
||||
Sat Oct 24 11:57:59 2015 Shugo Maeda <shugo@ruby-lang.org>
|
||||
|
||||
* vm_insnhelper.c: remove the typedef redeclaration of
|
||||
|
|
|
@ -216,13 +216,13 @@ rb_arity_error_new(int argc, int min, int max)
|
|||
{
|
||||
VALUE err_mess = 0;
|
||||
if (min == max) {
|
||||
err_mess = rb_sprintf("wrong number of arguments (%d for %d)", argc, min);
|
||||
err_mess = rb_sprintf("wrong number of arguments (given %d, expected %d)", argc, min);
|
||||
}
|
||||
else if (max == UNLIMITED_ARGUMENTS) {
|
||||
err_mess = rb_sprintf("wrong number of arguments (%d for %d+)", argc, min);
|
||||
err_mess = rb_sprintf("wrong number of arguments (given %d, expected %d+)", argc, min);
|
||||
}
|
||||
else {
|
||||
err_mess = rb_sprintf("wrong number of arguments (%d for %d..%d)", argc, min, max);
|
||||
err_mess = rb_sprintf("wrong number of arguments (given %d, expected %d..%d)", argc, min, max);
|
||||
}
|
||||
return rb_exc_new3(rb_eArgError, err_mess);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue