Hi anyone could help me with how to use Kotlin + D...
# android
l
Hi anyone could help me with how to use Kotlin + Dagger2 + Generics? I have a
@Provides Foo<*>
and then
@Provides Presenter(Foo<Bar>)
But this gives me an error
Foo<Bar> cannot be provided without an @Inject or @Provides-annotated method
😞 I've tried this already
@Provides Presenter(Foo<@JvmSupressWildcards Bar>)
but without Success
d
Dagger doesn't do well with generics. Personally I inject wrappers instead.
class Wrapper : Foo<Bar>
l
Yeah I ended creating an Interface 😕, thanks
I was just wondering because the same code works in Java
but I understand now