Affects back to 2.0 (when keyword args were introduced),
so this doesn't seem to be an optimization bug introduced in 2.1/2.2
I'm actually not sure about the specs and if there's some special case
for kwargs interacting with aref/aset...
The problem here is that the []= syntax compiled into a method dispatch where positional value arg is passed last, after keyargs, something you can't even do in ruby.
you can simulate the bug with a plain method:
deffoo(key,val,option: nil)endfoo(:key,1,option: 1)# okfoo(:key,{option: 1},1)# wrong number of arguments (3 for 2)
def []=(k,opt={},v) feels wrong because you're taking a dependency on incorrect behavior (method dispatch that puts a positional arg after the keyargs) Why not correct it for 3.0?