Fix Ruby 3.3 SyntaxError caused by anonymous keyword argument forwarding#215
Conversation
…hin block (SyntaxError)
|
Why was CI passing with 3.3? |
|
@mperham honestly I’m not entirely sure why CI didn’t catch this. I ran into it while updating After digging a bit, it turns out My best guess is that the affected methods/files are lazily loaded, and the Ruby 3.3 CI doesn’t end up requiring them, so the file never gets parsed in CI. I didn’t verify the exact test coverage, but locally the error reproduces reliably as soon as the file is required. |
|
@mperham thanks for merging! Did a few more tests. For what it's worth. Seems to be a ruby 3.3.0 only problem: https://bugs.ruby-lang.org/issues/20090 Example Ruby 3.3.0: Ruby 3.3.1 |
|
That explains it, thanks. |
Summary
Ruby 3.3 raises a
SyntaxErrorwhen anonymous keyword rest parameters (**) are forwarded.connection_poolwas still forwarding anonymous keyword arguments in several places, which causes the gem to fail on Ruby 3.3.This PR updates those method signatures to use named keyword rest parameters (
**kwargs) and forwards them explicitly.Impact
SyntaxErroron Ruby 3.3Testing
Verified locally on Ruby 3.3. Before this change, loading
bundle exec rake assets:precompileraised errors such as:After the fix, the code compiles and loads correctly.