-
Notifications
You must be signed in to change notification settings - Fork 44
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
Cumbersome injection with generics #188
Comments
The support of generics is lacking. There's also #135 tracking its support on modules. |
I've spent a fair bit of time trying to get dagger reflect to work in a large project and although most things CAN be worked around with reasonable effort, the lack of support for generics is what blocks me - eliminating them in this particular code base is sadly not a tempting approach at the moment. I will report my other findings in other tickets. |
In case anyone else digs into this, I found it useful to catch the unwanted generics at this point in the code in the debugger and then I could peek around in the scope to try to figure out what I really wanted: (If your code base is small enough you may even be able to fiddle the |
As an exercise purpose, I'm trying to add Dagger Reflect to Plaid project. After all necessary changes to make project compile I got runtime crash.
The issue is that HomeActivity should be injected by HomeComponent. The issue is that HomeComponent doesn't declare the inject method directly but rather implements generic injector interface BaseActivityComponent. Which implements BaseComponent that has generic method
During debug, I see that reflection is looking to parameter type of the method declaration which is resoled to Object rather than taking the type of the passed parameter HomeActivity.
I wonder what are you thoughts about the issue and the approach taken in the plaid app?
The text was updated successfully, but these errors were encountered: