Skip to content

Fix #2141 - Add component6..component10 operators to ParametersHolder - #2496

Open
Inf1mum wants to merge 1 commit into
InsertKoinIO:mainfrom
Inf1mum:fix/2141-parameters-holder-component6
Open

Inf1mum wants to merge 1 commit into
InsertKoinIO:mainfrom
Inf1mum:fix/2141-parameters-holder-component6

Conversation

@Inf1mum

@Inf1mum Inf1mum commented Nov 17, 2026

Copy link
Copy Markdown

Fixes #2141

Problem

ParametersHolder only defines destructuring operators component1..component5. Generated code that destructures 6+ injected parameters — e.g. from the annotations compiler for a class with 6 @InjectedParam constructor arguments — fails to build with:

Destructuring of type 'org.koin.core.parameter.ParametersHolder' requires operator function 'component6()'.

ParametersHolder itself already holds any number of values (parametersOf(1, 2, 3, 4, 5, 6) works today); only the destructuring operators stop at 5.

Fix

Add component6..component10 inline operators to ParametersHolder, mirroring the existing component1..component5 (same elementAt(i, T::class) semantics, same NoParameterFoundException on out-of-range). Purely additive — no behavior change for existing code.

Tests

  • destructure 6 parameters — the exact reported scenario (6 params)
  • destructure 6 parameters of mixed types — heterogeneous values
  • destructure 10 parameters — upper bound of the new operators

:core:koin-core:jvmTest --tests org.koin.core.ParametersHolderTest: 23 tests, 0 failures, 0 errors (includes the 20 pre-existing tests).

Signed-off-by: Inf1mum vadim.lazuk@mail.ru

…metersHolder

ParametersHolder only defined destructuring operators component1..component5,
so generated code destructuring 6+ injected parameters (e.g. from the
annotations compiler) fails to compile with:
"Destructuring of type 'org.koin.core.parameter.ParametersHolder' requires
operator function 'component6()'".

Add component6..component10 inline operators mirroring the existing ones,
plus destructuring tests. Purely additive, no behavior change for existing
code.

Signed-off-by: Inf1mum <vadim.lazuk@mail.ru>
@Inf1mum
Inf1mum force-pushed the fix/2141-parameters-holder-component6 branch from 1574785 to b5b5c81 Compare November 17, 2026 10:50

This branch has not been deployed

No deployments
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.

Destructuring of type 'org.koin.core.parameter.ParametersHolder' requires operator function 'component6()'.

1 participant