Forum: Ruby-core [ruby-trunk - Bug #7922][Open] Keyword arguments bug with unnamed rest

Posted by marcandre (Marc-Andre Lafortune) (Guest)
on 2013-02-23 16:50
(Received via mailing list)
Issue #7922 has been reported by marcandre (Marc-Andre Lafortune).

----------------------------------------
Bug #7922: Keyword arguments bug with unnamed rest
https://bugs.ruby-lang.org/issues/7922

Author: marcandre (Marc-Andre Lafortune)
Status: Open
Priority: High
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: next minor
ruby -v: r39390


We have:

    def foo(**ignore_all_options)
    end

    foo(bar: 42) # => nil, OK
    method(:foo).parameters # => [[:keyrest, :ignore_all_options]], OK

But:

    def foo(**)
    end

    foo(bar: 42) # => ArgumentError: unknown keyword: bar, expected nil
    method(:foo).parameters # => [], expected [[:keyrest]]
Posted by nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-02-24 15:17
(Received via mailing list)
Issue #7922 has been updated by nagachika (Tomoyuki Chikanaga).

Assignee changed from mame (Yusuke Endoh) to nagachika (Tomoyuki 
Chikanaga)


----------------------------------------
Backport #7922: Keyword arguments bug with unnamed rest
https://bugs.ruby-lang.org/issues/7922#change-36934

Author: marcandre (Marc-Andre Lafortune)
Status: Assigned
Priority: High
Assignee: nagachika (Tomoyuki Chikanaga)
Category:
Target version:


We have:

    def foo(**ignore_all_options)
    end

    foo(bar: 42) # => nil, OK
    method(:foo).parameters # => [[:keyrest, :ignore_all_options]], OK

But:

    def foo(**)
    end

    foo(bar: 42) # => ArgumentError: unknown keyword: bar, expected nil
    method(:foo).parameters # => [], expected [[:keyrest]]
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.