Files
kotlin-fork/compiler/testData/codegen/boxWithStdlib/callableReference/property/kt6870_privatePropertyReference.kt
T
Alexander Udalov 661f4efc68 Forbid callable references to members and extensions with empty LHS
This syntax is reserved to be likely used in the future as a shorthand for
"this::foo" where the resulting expression doesn't take the receiver as a
parameter but has "this" already bound to it
2015-10-03 04:37:04 +03:00

23 lines
415 B
Kotlin
Vendored

class Test {
private var iv = 1
public fun exec() {
val t = object : Thread() {
override fun run() {
Test::iv.get(this@Test)
Test::iv.set(this@Test, 2)
}
}
t.start()
t.join(1000)
}
fun result() = if (iv == 2) "OK" else "Fail $iv"
}
fun box(): String {
val t = Test()
t.exec()
return t.result()
}