Files
kotlin/compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt
Alexander Udalov 20e36438e2 Move some tests from boxWithStdlib/ to box/
Move those tests which do not require neither stdlib nor reflect
2016-03-09 10:25:38 +03:00

32 lines
473 B
Kotlin
Vendored

var state = ""
var topLevel: Int
get() {
state += "1"
return 42
}
set(value) {
throw AssertionError("Nooo")
}
class A {
val member: String
get() {
state += "2"
return "42"
}
}
val A.ext: Any
get() {
state += "3"
return this
}
fun box(): String {
(::topLevel)()
(A::member)(A())
(A::ext)(A())
return if (state == "123") "OK" else "Fail $state"
}