We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1832684 commit d5bfde2Copy full SHA for d5bfde2
src/test/kotlin/com/fasterxml/jackson/module/kotlin/_ported/test/ParameterNameTests.kt
@@ -200,6 +200,17 @@ class TestJacksonWithKotlin {
200
assertEquals(pascalCasedJson, test1out)
201
}
202
203
+ private class HasSameParamNameConstructor(val value: Int) {
204
+ constructor(value: Short) : this(value.toInt() + 100)
205
+ }
206
+
207
+ @Test fun findingPrimaryConstructor() {
208
+ val json = "{\"value\":1}"
209
210
+ // If there is more than one constructor, the primary constructor will be used.
211
+ assertEquals(1, normalCasedMapper.readValue<HasSameParamNameConstructor>(json).value)
212
213
214
// ==================
215
216
private class StateObjectWithFactory private constructor(
0 commit comments