Why this isn’t working? ``` Kodein.Module(name = "...
# kodein
c
Why this isn’t working?
Copy code
Kodein.Module(name = "web") {
        bind<Controller>(tag = "health") with singleton { HealthController(instance()) }
        bind<Controller>(tag = "user") with singleton { UserController(instance()) }

        bind() from singleton { Server(allInstances<Controller>()) }
}
Copy code
class Server(private val routes: List<Controller>)  { ... }
When I debug
routes
, it is an empty list. Thanks in advance!
r
This is because you tagged your bindings
the
allInstances
method signature is
allInstances(tag: Any? = null)
, by default it returns all the instances of a given type, that are not tagged in the Kodein container
You probably should use explicit types to use allInstances, without tagging them if its not needed
there is already a thread on that here
c
Thanks a lot!