spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Support Kotlin Context Parameters

Open SIMULATAN opened this issue 3 months ago • 4 comments

Note: finding a commit message for this change is quite difficult, the current one is likely to cause confusion. I'd appreciate better suggestions

Originally introduced as Beta in 2.2.0, Context Parameters are a new Kotlin feature that I wanted to use in my project. Those parameters have a different KParameter.Kind (CONTEXT) and are therefore not supported by the current CoroutinesUtils implementation. This resulted in the following error message:

java.lang.IllegalArgumentException: No argument provided for a required parameter: context parameter tenant of context(tenant: com.application.TenantContext)

Status

~~kotlin-reflect's Context Parameters support was first released in 2.2.20-Beta1. Therefore, I had to target the latest 2.2.20 RC with this PR.~~ ~~Once 2.2.20 is formally released, I'll await the update on Spring's main branch, rebase onto it, and set the PR as ready to merge.~~ With 86fb62c05998f776e42b7960d9c039f00645ebb2, main is using the latest Kotlin release. I've done the rebase and marked the PR as ready to review. Thanks in advance for your considerations!

SIMULATAN avatar Sep 05 '25 13:09 SIMULATAN