Update: I have 1 interface that implements multipl...
# kodein
j
Update: I have 1 interface that implements multiple interfaces. The implementation of that interface is a singleton. I try to bind the instance to all the different interfaces that it implements. On 6.5.5 this was working fine, on 7.0.0 I get the error mentioned above. Is this worth reporting or am I doing something wrong?
oh I see my binding multiple interfaces to the same instance might be an issue
Copy code
fun mainViewModule() = DI.Module("MainModule") {
    bind<MainContract.ViewModel>() with singleton { MainViewModel(instance()) }
    bindToExisting<LoginContract.Handler, MainContract.ViewModel>()
    bindToExisting<CurrentUserSummaryContract.Handler, MainContract.ViewModel>()
    bindToExisting<QuizDetailsContract.Handler, MainContract.ViewModel>()
    bindToExisting<QuizOverviewContract.Handler, MainContract.ViewModel>()
}

inline fun <reified I : Any, reified T : I> DI.Builder.bindToExisting() {
    bind<I>() with provider {
        val implementation by di.instance<T>()
        implementation
    }
}
s
@Joost Klitsie This looks like a bug in the Kotlin/JS compiler. You shlould report it in the Kotlin Issue tracker
j
@salomonbrys I opened an issue in the kodein github as the issue only occurred with the same Kotlin version, but higher Kodein version. Is there proof I can use to blame the Kotlin/JS compiler? Because I gladly open a ticket in the Kotlin Issue tracker, but I wouldn't know what to write exactly 🙂
s
Other that this is a compiler generated message, no. This is not a Kodein exception. This is generated by the computer.
j
Okay! Thanks