Files
kotlin-fork/backend.native/tests/external/codegen/boxInline/callableReference/classLevel2.kt
T
2017-03-13 15:31:46 +03:00

23 lines
301 B
Kotlin

// FILE: 1.kt
package test
class A(val z: Int) {
fun calc() = z
fun test() = call(A(z), A::calc)
}
inline fun call(p: A, s: A.() -> Int): Int {
return p.s()
}
// FILE: 2.kt
import test.*
fun box() : String {
val call = A(11).test()
return if (call == 11) "OK" else "fail"
}