Skip to content

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

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

Closed
spring-projects-issues opened this issue Nov 5, 2018 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid theme: kotlin An issue related to Kotlin support type: enhancement A general enhancement

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

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

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

@sdeleuze
Copy link
Contributor

sdeleuze commented Dec 7, 2023

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.

@sdeleuze sdeleuze closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2023
@sdeleuze sdeleuze removed this from the 6.x Backlog milestone Dec 7, 2023
@sdeleuze sdeleuze added the status: invalid An issue that we don't feel is valid label Dec 7, 2023
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) status: invalid An issue that we don't feel is valid theme: kotlin An issue related to Kotlin support type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants