Skip to content

Support for parameter name introspection on Kotlin inline classes [SPR-17466] #21998

Closed as not planned
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is validtheme: kotlinAn issue related to Kotlin supporttype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions