In general I like Kodein so far, except for one th...
# kodein
r
In general I like Kodein so far, except for one thing I'm not super-fond off -- the idea of using
instance()
when injecting deps into bindings loses me a bit of type-safety. For example, in Dagger 2 I might have this:
@Provides @Singleton fun bootable(appServices: MutableSet<AppService>): Bootable = Bootable(appServices)
and in Kodein (I think) this becomes:
Copy code
bind() from setBinding<AppService>()
bind<Bootable>() with singleton { Bootable(instance()) }
If, for example, I changed the first parameter of the constructor of
Bootable
to something other than
Set<AppService>
that doesn't have a binding, Dagger will give me a compile-time error but Kodein won't. Is there a way to keep this type-safety of Dagger 2?