Problem
In kotlin, with the following module configuration for guice
fun configureFoo(binder: Binder) {
binder.bind(object: TypeLiteral<Foo<Iterable<Any>>>() {}).to(MyFoo::class.java)
}
And the example classes
interface Foo<T> {
// ...
}
class MyFoo : Foo<Iterable<Any>> {
// ...
}
class User @Inject constructor(foo: Foo<Iterable<Any>>) {
// ...
}
I get the guice configuration error:
No implementation for Foo<java.lang.Iterable<Any>> was bound. ...
What I've tried
I can fix this by changing Iterable to java.lang.Iterable everywhere... but thats a bad workaround loosing all the benefits of kotlin.collections.Iterable.
Question
Does anyone know this problem and has a better solution?