Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
spring-projects-issues opened this issue Nov 5, 2018 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: kotlin An issue in or related to Kotlin support type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 5, 2018

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:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 5, 2018

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...

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.2 RC1 milestone Jan 11, 2019
@sdeleuze
Copy link
Contributor

sdeleuze commented Mar 27, 2019

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: kotlin An issue in or related to Kotlin support type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants