From: Joseph Jones Date: 2015-12-17T21:05:58-07:00 Subject: [ruby-core:72250] [Ruby trunk - Bug #11771] [Open] unable to pass keyargs to []= --56738626_1befd79f_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 4, 2015 at 12:42:= 21 MST, alxtskrnk=40gmail.com wrote:Issue =2311771 has been reported by b= ug hit.----------------------------------------Bug =2311771: unable to pa= ss keyargs to =5B=5D=3Dhttps://bugs.ruby-lang.org/issues/11771* Author: b= ug hit* Status: Open* Priority: Normal* Assignee: * ruby -v: 2.2.3* Backp= ort: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN--------------------------= --------------=60=60=60rubymodule =46oo def self.=5B=5D=3D(key, val, opti= on: nil) endend=46oo=5B:key=5D =3D 1 =23 ok=46oo=5B:key, option: 1=5D =3D= 1 =23 wrong number of arguments (3 for 2)=60=60=60if you declare the =5B= =5D=3D params using *=60=60=60rubymodule Bar def self.=5B=5D=3D(*args) p = args endendBar=5B:key, option: 1=5D =3D 1 =23 args: =5B:key, =7B:option=3D= >1=7D, 1=5D=60=60=60the args end up =5B:key, =7B:option=3D>1=7D, 1=5D whi= ch seems wrong since the keyargs hash is supposed to be last-- https://bu= gs.ruby-lang.org/ --56738626_1befd79f_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 4, 2015 at 12:42:21 MST, alxtskrnk=40gmail.com wrote:
Issue =2311771 has been repor= ted by bug hit.

----------------------------------------
= Bug =2311771: unable to pass keyargs to =5B=5D=3D
https://bugs.ruby-= lang.org/issues/11771

* Author: bug hit
* Status: Open* Priority: Normal
* Assignee:
* ruby -v: 2.2.3
* Back= port: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
-------------------= ---------------------
=60=60=60ruby
module =46oo
def sel= f.=5B=5D=3D(key, val, option: nil)

end
end

=46= oo=5B:key=5D =3D 1 =23 ok


=46oo=5B:key, option: 1=5D =3D= 1 =23 wrong number of arguments (3 for 2)

=60=60=60

if you declare the =5B=5D=3D params using *

=60=60=60ruby
module Bar
def self.=5B=5D=3D(*args)
p args
end
end

Bar=5B:key, option: 1=5D =3D 1 =23 args: =5B:k= ey, =7B:option=3D>1=7D, 1=5D

=60=60=60

the args end= up =5B:key, =7B:option=3D>1=7D, 1=5D which seems wrong since the keyargs= hash is supposed to be last




--
https:= //bugs.ruby-lang.org/
--56738626_1befd79f_16c--