74e8c7c1c5
Quoted from https://kotlinlang.org/docs/reference/classes.html "On the JVM, if all of the parameters of the primary constructor have default values, the compiler will generate an additional parameterless constructor which will use the default values. This makes it easier to use Kotlin with libraries such as Jackson or JPA that create class instances through parameterless constructors."
11 lines
191 B
Kotlin
Vendored
11 lines
191 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
|
|
// WITH_RUNTIME
|
|
|
|
private data class C(val status: String = "OK")
|
|
|
|
fun box(): String {
|
|
val c = (C::class.java.getConstructor().newInstance())
|
|
return c.status
|
|
}
|