Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-17466

Support for parameter name introspection on Kotlin inline classes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.1.2
    • Fix Version/s: 5.2 RC1
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      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.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sdeleuze Sébastien Deleuze
              Reporter:
              reckter reckter
              Last updater:
              Spring Issuemaster
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Days since last comment:
                1 year, 40 weeks, 6 days ago