mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
23 lines
367 B
Kotlin
Vendored
23 lines
367 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
|
|
}
|
|
|
|
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"
|
|
}
|