Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kwargs are sent to super class initializer that does not accept kwargs #80

Open
oeoeaio opened this issue Mar 3, 2022 · 0 comments
Open

Comments

@oeoeaio
Copy link

oeoeaio commented Mar 3, 2022

Describe the bug

When the class hierarchy includes a direct parent that splats args but whose own parent (i.e. grandparent of child) does not accept any kwargs, the current implementation for the kwargs strategy will still attempt to pass-through any kwargs not listed as dependencies of the parent to the grandparent, resulting in an ArgumentError.

To Reproduce

The test I have added in #81 will fail without the corresponding update to the implementation.

Expected behavior

We should still be able to use the default kwargs strategy for dependency injection even with two layers of dependency injection in the hierarchy and a super class that does not itself accept kwargs. (This may or may not be a valid expectation, but I could not find any documentation to contradict it).

My environment

  • Affects my production application: NO, but (for reasons not worth elaborating on here) is blocking upgrade of prod system to ruby 3
  • Ruby version: 3.1.1
  • OS: macOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant