ruby-changes:40183
From: duerst <ko1@a...>
Date: Sat, 24 Oct 2015 12:47:49 +0900 (JST)
Subject: [ruby-changes:40183] duerst:r52264 (trunk): vm_insnhelper.c: improved error message for "wrong number
duerst 2015-10-24 12:47:40 +0900 (Sat, 24 Oct 2015) New Revision: 52264 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52264 Log: vm_insnhelper.c: improved error message for "wrong number of arguments", distinguishing given and expected argument numbers clearly. [Feature #9025] Modified files: trunk/ChangeLog trunk/vm_insnhelper.c Index: ChangeLog =================================================================== --- ChangeLog (revision 52263) +++ ChangeLog (revision 52264) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Oct 24 12:47:47 2015 Martin Duerst <duerst@i...> + + * 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@r...> * vm_insnhelper.c: remove the typedef redeclaration of Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 52263) +++ vm_insnhelper.c (revision 52264) @@ -216,13 +216,13 @@ rb_arity_error_new(int argc, int min, in https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L216 { 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/