From: "mame (Yusuke Endoh)" Date: 2012-04-24T20:18:13+09:00 Subject: [ruby-core:44585] [ruby-trunk - Bug #6086] Number of arguments and named parameters Issue #6086 has been updated by mame (Yusuke Endoh). Assignee changed from mame (Yusuke Endoh) to matz (Yukihiro Matsumoto) Matz, what do you think? I'm not against this. But I'm not sure how surprising this behavior is, until I encounter it in actual use case. "(1 for 0 **)" is not very good-looking, but I have no alternative idea. -- Yusuke Endoh ---------------------------------------- Bug #6086: Number of arguments and named parameters https://bugs.ruby-lang.org/issues/6086#change-26157 Author: marcandre (Marc-Andre Lafortune) Status: Assigned Priority: Low Assignee: matz (Yukihiro Matsumoto) Category: core Target version: 2.0.0 ruby -v: r34800 While working on the messages of "wrong number of arguments" error (see #6085), I realized that the new named parameter feature can lead to misleading error messages: def foo(x: 42) end arg = {x: :bar} foo(arg) # => nil (no error) arg = :bar foo(arg) # => ArgumentError: wrong number of arguments (1 for 0) It would be better if the wording was changed for methods accepting options. Maybe something like: foo(arg) # => ArgumentError: wrong number of arguments (1 for 0 **) Suggestions? -- http://bugs.ruby-lang.org/