diff options
| author | Alan Wu <XrXr@users.noreply.github.com> | 2024-02-08 19:10:51 -0500 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2024-02-12 13:02:50 -0500 |
| commit | e878bbd641f255b5d8f9e99b84ff8082a5b7fdaf (patch) | |
| tree | 787eec71f807891edabbb15023e31b08c793bee2 /test/ruby | |
| parent | e08c128417fd840c72f8e7d6cbfa59970fb7a5b8 (diff) | |
Allow `foo(**nil, &block_arg)`
Previously, `**nil` by itself worked, but if you add a block argument,
it raised a conversion error. The presence of the block argument
shouldn't change how keyword splat works.
See: <https://bugs.ruby-lang.org/issues/20064>
Diffstat (limited to 'test/ruby')
| -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 06bba60ac5..a856a46569 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -189,6 +189,7 @@ class TestKeywordArguments < Test::Unit::TestCase def self.a0; end assert_equal(nil, a0(**nil)) assert_equal(nil, :a0.to_proc.call(self, **nil)) + assert_equal(nil, a0(**nil, &:block)) def self.o(x=1); x end assert_equal(1, o(**nil)) |
