Could someone explain when two `single {}` declara...
# koin
n
Could someone explain when two
single {}
declarations with the same bound type will result in an override, and when will be both available for
getAll()
? Thanks.
For example
Copy code
single(createdAtStart = true) {
            Runnable {
                println("running#1")
            }.also {
                it.run()
            }
        }
        single(createdAtStart = true) {
            Runnable {
                println("running#2")
            }.also {
                it.run()
            }
        }
results in printing only
running#1
although I apply
allowOverride(false)
to the container. I expected the container either to fail or no overriding to happen...
m
n
in my example above both declarations have the same type (
Runnable
), so they should override, shouldn't they?
a
yes, the 2nd should take over the first