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-issuemaster opened this issue Nov 5, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

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:

  • #20945 Upgrade to Kotlin 1.3
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

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

@sdeleuze

This comment has been minimized.

Copy link
Contributor

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?

@sdeleuze sdeleuze modified the milestones: 5.2 M1, 5.x Backlog Mar 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.