mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
21 lines
354 B
Kotlin
Vendored
21 lines
354 B
Kotlin
Vendored
// FILE: 1.kt
|
|
// LANGUAGE_VERSION: 1.2
|
|
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
|
package test
|
|
|
|
val Int.myInc
|
|
get() = this + 1
|
|
|
|
|
|
inline fun inlineFun(lambda: () -> Int = 1::myInc): Int {
|
|
return lambda()
|
|
}
|
|
|
|
// FILE: 2.kt
|
|
|
|
import test.*
|
|
|
|
fun box(): String {
|
|
val result = inlineFun()
|
|
return if (result == 2) return "OK" else "fail $result"
|
|
} |