This is also an issue with array destructuring: ```ruby def a(*b) b end a = [1,2,3] a a => [[1, 2, 3]] a *a TypeError: no implicit conversion of Array into Integer a(*a) => [1, 2, 3] ``` This is on Ruby 2.2.3.seanlinsley (Sean Linsley)
I prefer Marc's proposal here: https://bugs.ruby-lang.org/issues/11816#note-6. I think that's the much more natural than the existing behavior. I found this ticket after being surprised by the behavior, as I attempted to update my projec...seanlinsley (Sean Linsley)
Currently, this assigns the `username` variable: ```ruby /(?<username>.*)@.*\..*/ =~ "seanlinsley@example.com" ``` But this does not: ```ruby /(?<username>.*)@.*\..*/ === "seanlinsley@example.com" ``` If it did, it would ...seanlinsley (Sean Linsley)
I'd rename this bug to something like "block-level hash destructuring only works for the last argument" if Redmine let you rename bugs...seanlinsley (Sean Linsley)
Koichi Sasada wrote: > Problem is what happen when `h' is not a hash object (and doesn't have to_hash method). > ... I don't follow. Can't this assignment behave the same way that method argument destructuring does? This currently work...seanlinsley (Sean Linsley)
This is what I'm imagining: ~~~ruby a, *b, c:, d: 'd', **e = [1, {c: 2}] a == 1 b == [] c == 2 d == 'd' e == {} # holds any extras just like `b` ~~~ Where an error would be thrown if the hash didn't have the given key, and...seanlinsley (Sean Linsley)