Skip to content
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

shouldn't inject parameters when qualifier is present #2090

Open
wants to merge 1 commit into
base: 4.1.0
Choose a base branch
from

Conversation

luozejiaqun
Copy link

example:

module {
    single(named("echo")) { "Hello," + it.get<String>() }
}

koin.get<String>(named("echo")) { parametersOf("World!") } // this should be "Hello,World!", but we get "World!"

PS. this issue will effect multibinding with parameters:

module {
    declareSetMultibinding<String> {
        intoSet { it.get<String>() + "1" }
        intoSet { it.get<String>() + "2" }
    }
}
koin.getSetMultibinding<String> { parametersOf("set element prefix") }

multibinding #1951

@luozejiaqun
Copy link
Author

luozejiaqun commented Dec 25, 2024

i also think it's kind of weird that we can't do this:

module {
    single { "Hello," + it.get<String>() }
}

koin.get<String> { parametersOf("World!") } // never get "Hello,World!", always "World!"

when the declared type is same to the parameter and no qualifier presents, the parameter always win.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant