Files
kotlin/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt
2017-07-03 10:51:51 +02:00

21 lines
359 B
Kotlin
Vendored

// FILE: 1.kt
// LANGUAGE_VERSION: 1.2
// SKIP_INLINE_CHECK_IN: inlineFun$default
package test
val Long.myInc
get() = this + 1
inline fun inlineFun(lambda: () -> Long = 1L::myInc): Long {
return lambda()
}
// FILE: 2.kt
import test.*
fun box(): String {
val result = inlineFun()
return if (result == 2L) return "OK" else "fail $result"
}