Files
kotlin-fork/backend.native/tests/external/codegen/box/properties/privatePropertyInConstructor.kt
T
2017-03-13 15:31:46 +03:00

19 lines
330 B
Kotlin

class A(
private val x: String,
private var y: Double
) {
fun foo() {
val r = {
if (x != "abc") throw AssertionError("$x")
y = 0.0
if (y != 0.0) throw AssertionError("$y")
}
r()
}
}
fun box(): String {
A("abc", 3.14).foo()
return "OK"
}