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
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.
The text was updated successfully, but these errors were encountered:
When attempting to multibind classes with type parameters:
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.
The text was updated successfully, but these errors were encountered: