-
-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using constructor DSL to bind multiple classes via lambdas to the same interface does not work #1463
Comments
IMO
should also throw a
|
Yes, as you know from my SO question I'm looking at Koin from a Service Locator / plugin registry perspective. And there, it makes sense to be able to bind multiple implementations to the same interface, so all plugin instances could be retrieved via |
Yes you're right, I didn't understand that Koin indeed allows to inject multiple implementations that can be retrieved into a list . |
I fixed it back, to allow bind() for 2 same type |
Describe the bug
The code
throws
org.koin.core.error.DefinitionOverrideException: Already existing definition for [Singleton:'dev.schuberth.stan.exporters.ExcelExporter',binds:dev.schuberth.stan.exporters.Exporter] at dev.schuberth.stan.exporters.Exporter::_root_
.Note that using the alternative operator-syntax
works.
To Reproduce
Just use above code snippets.
Expected behavior
{ bind<Exporter>() }
syntax should work just likebind Exporter::class
syntax.Koin project used and used version (please complete the following information):
koin-core version 3.2.2
Additional moduleDefinition
n/a
The text was updated successfully, but these errors were encountered: