Hum, in fact, digging a bit more, it's not an issue with Kotlin, it's an issue with what Spring is trying to do. In KotlinReflectionParameterNameDiscoverer, they should at least check that the Kotlin function/constructor returns the same number of parameters than the Java method/constructor before considering they are interchangeable. It is definitely not the case with Kotlin enums as Kotlin has added synthetic parameters in the JVM constructors. Kotlin does not return the synthetic parameters added to the JVM version so either Spring has to fill the gaps with forged names or they have to return the parameter names coming from the JVM if the elements does not match. Could you open a Spring issue then? Thanks! |