You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow type parameters binding, with star type added #694
When attempting to multibind classes with type parameters:
@ContributesMultibinding(SomeScope::class)
class MyClass: SomeInterface<String>
Anvil will complain that Type parameters in bindings are not supported. This binding needs to be contributed in a Dagger module manually.
I understand that this is a problem, because Anvil can't know what type parameter should be used on bound type (there is no way to specify that in annotation). But, maybe we could just support the most basic version?
We could just add star to all type bindings, so above example would get bound to the SomeInterface<*> type. It does not cover many use cases, but I think it's still better than not supporting this at all. Any other non-star cases can still use module like now.
I'm willing to submit PR for this, if desired.
Reacted by Mustafa Berkay Mutlu, Christopher-Marcel Esser, Blake Oliveira, Muhammed Saneef, Ankush Gupta, Paul Woitaschek, Kyrillos Gaitanis, Kevin Chiu, Esa Firman and Andrey Mischenko
Activity