Last active
August 29, 2015 14:12
-
-
Save brixen/fbd4a1cebb23ef6b4d85 to your computer and use it in GitHub Desktop.
Keyword rest argument processing is inconsistent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby -v keyword_gotcha.rb | |
ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13] | |
1 | |
{:b=>2} | |
{:b=>2} | |
1 | |
{} | |
{:gotcha=>1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def m(a: 1, **kw) | |
p a, kw | |
kw[:gotcha] = 1 | |
end | |
h = {b: 2} | |
m h | |
p h | |
h = {} | |
m h | |
p h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment