diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-01-21 16:14:10 -0800 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2020-01-22 10:27:02 -0800 |
commit | 28d31ead34baff1c4abc0d7d902ef4bc1d576fb2 (patch) | |
tree | ce5ca7a1ccb88b4045a491448acd283830ea8721 /lib/pp.rb | |
parent | 90f5c3c1ea34c992dc0f36593bf6141695dfdf67 (diff) |
Fix pp when passed a empty ruby2_keywords-flagged hash as array element
This causes problems because the hash is passed to a block not
accepting keywords. Because the hash is empty and keyword flagged,
it is removed before calling the block. This doesn't cause an
ArgumentError because it is a block and not a lambda. Just like
any other block not passed required arguments, arguments not
passed are set to nil.
Issues like this are a strong reason not to have ruby2_keywords
by default.
Fixes [Bug #16519]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2855
Diffstat (limited to 'lib/pp.rb')
-rw-r--r-- | lib/pp.rb | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -223,7 +223,7 @@ class PP < PrettyPrint else sep.call end - yield(*v) + yield(*v, **{}) } end |