Skip to content

Commit

Permalink
shouldn't inject parameters when qualifier is present
Browse files Browse the repository at this point in the history
  • Loading branch information
luozejiaqun committed Dec 25, 2024
1 parent dbd945b commit 23e64b1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class Scope(
}

private inline fun <T> resolveFromInjectedParameters(ctx: ResolutionContext): T? {
return if (ctx.parameters == null) null
return if (ctx.parameters == null || ctx.qualifier != null) null
else {
_koin.logger.debug("|- ? ${ctx.debugTag} look in injected parameters")
ctx.parameters.getOrNull(clazz = ctx.clazz)
Expand All @@ -331,7 +331,7 @@ class Scope(

private inline fun <T> resolveFromStackedParameters(ctx: ResolutionContext): T? {
val current = parameterStack?.get()
return if (current.isNullOrEmpty()) null
return if (current.isNullOrEmpty() || ctx.qualifier != null) null
else {
_koin.logger.debug("|- ? ${ctx.debugTag} look in stack parameters")
val parameters = current.firstOrNull()
Expand Down

0 comments on commit 23e64b1

Please sign in to comment.