0
これはバグかどうかわかりませんが、間違っているだけです。 、Kodein factory bindingsがNotFoundExceptionをスローしています
class KodeinConfidenceTest {
@Test
fun testThatKodeinWorks() {
val kodein = Kodein {
bind<Dice>() with factory { sides: Int -> RandomDice(sides) }
}
val d:Dice = kodein.instance(5)
}
}
open class Dice
data class RandomDice(val sides:Int) : Dice()
...しかし、これはNotFoundExceptionに
com.github.salomonbrys.kodein.Kodein$NotFoundException: No provider found for bind<Dice>("5") with ? { ? }
Registered in Kodein:
bind<Dice>() with factory { Int -> RandomDice }