Files
kotlin/compiler/testData/codegen/box/defaultArguments/callDefaultFromInitializer.kt
2019-11-21 15:53:52 +03:00

17 lines
213 B
Kotlin
Vendored

fun foo(x: Int = 42) = x
class C {
val s: String
init {
val x = foo()
if (x == 42)
s = "OK"
else
s = "fail"
}
}
fun box(): String {
return C().s
}