Hey guys! Anybody know how can I use Dagger 2 with...
# announcements
x
Hey guys! Anybody know how can I use Dagger 2 with kotlin collections? When I write:
Copy code
@Provides provideFoo(): Foo = Foo()
@Provides provideBar(foo: Foo): Bar = Bar(foo)
all works fine, but when I try to use List or Set, or other collection classes:
Copy code
@Provides provideFooList(): List<Foo> = listOf(Foo())
@Provides provideBar(fooList: List<Foo>): Bar = Bar(fooList)
I have compilation error: List<? extends Foo> cannot be provided without an @Provides- or @Produces-annotated method. Anybody know how resolve this problem?