Add AOT support for Kotlin constructors with optional parameters #29820
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
theme: aot
An issue related to Ahead-of-time processing
theme: kotlin
An issue related to Kotlin support
type: enhancement
A general enhancement
Milestone
Take the following kotlin
@Service
:When running on JVM the code behaves as expected: only the constructor parameter without a default value is autowired.
When running the native image the application does not start and throws the following exception indicating that spring
attempts to autowire all constructor parameters (even the one with a default value):
Reproducer with details: https://github.com/DarkAtra/spring-native-kotlin-di-issue
Affected Spring Framework versions:
6.0.2
,6.0.3
,6.0.4
(verified by building the current spring-boot main branch locally)The text was updated successfully, but these errors were encountered: