rocketraman
01/11/2018, 3:25 PMinstance()
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:
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?