Skip to content

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

Closed as not planned

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:

Activity

  1. spring-projects-issues commented on Nov 5, 2018

    @spring-projects-issues
    CollaboratorAuthor

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

  2. added
    type: enhancement
    in: core
    on Jan 11, 2019
  3. sdeleuze commented on Mar 27, 2019

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

  4. modified the milestones: 5.2 M1, 5.x Backlog on Mar 27, 2019
  5. added
    theme: kotlin
    on Jan 19, 2022
  6. sdeleuze commented on Dec 7, 2023

    @sdeleuze
    Contributor

    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.

  7. removed this from the 6.x Backlog milestone on Dec 7, 2023
  8. added
    status: invalid
    on Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: corestatus: invalidtheme: kotlintype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions