mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
21 lines
271 B
Kotlin
Vendored
21 lines
271 B
Kotlin
Vendored
// FILE: 1.kt
|
|
|
|
package test
|
|
|
|
class A(val z: Int) {
|
|
fun calc() = z
|
|
}
|
|
|
|
inline fun call(p: A, s: A.() -> Int): Int {
|
|
return p.s()
|
|
}
|
|
|
|
// FILE: 2.kt
|
|
|
|
import test.*
|
|
|
|
fun box() : String {
|
|
val call = call(A(11), A::calc)
|
|
return if (call == 11) "OK" else "fail"
|
|
}
|