Affects: 6.0.13


When using @Async with Kotlin functions, it is not possible to use Unit?-returning functions. kotlin.Unit corresponds to void in Java (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/), but the nullable version is not recognized when submitting the task: https://github.com/spring-projects/spring-framework/blob/main/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java#L295

Comment From: sdeleuze

Could you please provide a reproducer as an attached archive or a link to a repository?

Comment From: HappyHepo

While creating a reproduction, I narrowed the issue down. It actually does only occur when returning Unit?, I updated the original issue accordingly. minimal reproduction

Comment From: sdeleuze

Interesting, thanks for sharing, I will have a deeper look.