diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-09-08 20:51:56 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-09-08 22:47:06 -0700 |
commit | 61d90da25c027f896ddc0e71c7b17c67d4b12a97 (patch) | |
tree | 00f79e30acd34f270132d719e2e5ffaf66fa323c /test/ruby/test_keyword.rb | |
parent | 6382f5cc91ac9e36776bc854632d9a1237250da7 (diff) |
Fix invalid keyword argument separation warning for delegating calls
This removes an invalid keyword argument separation warning for
code such as:
```ruby
def foo(arg)
arg
end
kw = {}
foo(*[1], **kw)
```
This warning was caused because the remove_empty_keyword_hash
was set based on a comparison with two variables, and in this
case, one of the variables was updated after the check and we
need to use the updated variable.
Simplify things by just inlining the comparison.
Diffstat (limited to 'test/ruby/test_keyword.rb')
-rw-r--r-- | test/ruby/test_keyword.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index 5864ec9588..5ddcfd892a 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -215,6 +215,7 @@ class TestKeywordArguments < Test::Unit::TestCase assert_warn(/The keyword argument is passed as the last hash parameter.* for `m'/m) do assert_equal(kw, c.m(**kw)) end + assert_equal(kw, c.m(kw, **kw)) assert_equal(h, c.m(**h)) assert_equal(h, c.m(a: 1)) assert_equal(h2, c.m(**h2)) |