Closed spring-projects-issues closed 9 months ago
Juergen Hoeller commented
Sébastien Deleuze, if there is a chance to bring this forward to 5.1.x (without a full upgrade to Kotlin 1.3 on our end), feel free to go for it...
@reckter Inline classes are experimental in 1.3, so I am not sure we should do anything in 5.2, and I am wondering if that should not be raised on Kotlin side. Any thoughts?
Spring Data now provides dedicated related support and Spring Framework 6.1 also improved value Kotlin value classe support, so as I am not sure this old issue is valid anymore, I close it.
reckter opened SPR-17466 and commented
In org.springframework.core.KotlinReflectionParameterDiscoverer::get ParameterNames() spring tries to get names of parameters, by getting the kotlin function and calling getParameters() on it.
If you use the new inline class feature (since kotlin 1.3) in data classes, spring data mongo can not build the mapper, because the function mentioned above, returns null.
The cause for this is, that kotlin create a syntetic constructer as the default constructor, that unboxes the inline classes. Because of that, the ReflectJvmMapping.getKotlinFunction returns null, as the function is not a kotlin function, but a created one.
The getParameterNames function should support syntetic functions, if somehow possible, so we can use inline classes fully in the spring framework.
Affects: 5.1.2
Issue Links:
20945 Upgrade to Kotlin 1.3