We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Missing definitions when underyling class is unknown by koin. I belive this is due to the name of the definition overriding another.
To Reproduce Steps to reproduce the behavior:
This test fails.
class TestGetAllWithLogicInSingleBlock { interface Foo class A : Foo class B : Foo @Test fun `check get all with logic in single block`() { val app = koinApplication { modules(module { single { if (Random.nextBoolean()) { A() } else { B() } } bind Foo::class single { if (Random.nextBoolean()) { A() } else { B() } } bind Foo::class }) } app.koin.getAll<Foo>().shouldHaveSize(2) } }
Expected behavior I would expect two instances of Foo to be available in getAll<Foo>()
Foo
getAll<Foo>()
Koin module and version: koin-core:4.0.1
koin-core:4.0.1
Additional information adding qualifiers fixes the issue:
This test passes (as expected)
@Test fun `check get all with logic in single block`() { val app = koinApplication { modules(module { single(qualifier("1")) { if (Random.nextBoolean()) { A() } else { B() } } bind Foo::class single(qualifier("2")) { if (Random.nextBoolean()) { A() } else { B() } } bind Foo::class }) } app.koin.getAll<Foo>().shouldHaveSize(2) }
The text was updated successfully, but these errors were encountered:
linked to this? #1811 (comment)
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Missing definitions when underyling class is unknown by koin. I belive this is due to the name of the definition overriding another.
To Reproduce
Steps to reproduce the behavior:
This test fails.
Expected behavior
I would expect two instances of
Foo
to be available ingetAll<Foo>()
Koin module and version:
koin-core:4.0.1
Additional information
adding qualifiers fixes the issue:
This test passes (as expected)
The text was updated successfully, but these errors were encountered: