Files
kotlin/compiler/testData/codegen/boxInline/callableReference/classLevel2.kt
2016-11-28 16:33:58 +03:00

25 lines
397 B
Kotlin
Vendored

// Enable when using lambdas as extension lambdas is supported (KT-13312)
// IGNORE_BACKEND: JS
// 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"
}