You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add test cases for Kotlin private constructor instantiation edge cases.
This commit adds two test cases to demonstrate a bug in Kotlin constructor resolution when dealing with private constructors. The first test case shows the failure scenario where a private constructor without default parameter values causes a runtime exception. The second test case demonstrates that adding default parameter values to the private constructor doesn't display the same issue.
The bug seems to occur because the code incorrectly assumes that private constructors always generate synthetic parameters for both the default mask and the DefaultConstructorMarker. However, when a private primary constructor has no default parameter values, the Kotlin compiler only generates the DefaultConstructorMarker variant, not the mask parameter.
References #3389
Signed-off-by: Edward Poot <edwardmp@gmail.com>
Copy file name to clipboardExpand all lines: src/test/kotlin/org/springframework/data/mapping/model/KotlinClassGeneratingEntityInstantiatorUnitTests.kt
0 commit comments