Files
kotlin-fork/compiler/testData/codegen/box/compileKotlinAgainstKotlin/adaptedSuspendFunctionReference.kt
T
Alexander Udalov 21e9bd7ea2 Add regression tests for obsolete issues
#KT-9304
 #KT-14961
 #KT-16549
 #KT-21080
 #KT-28234
 #KT-30102
 #KT-31994
 #KT-34291
 #KT-38099
 #KT-41174
 #KT-44622
 #KT-44701
 #KT-44781
 #KT-44849
 #KT-44978
 #KT-45081
 #KT-45286
 #KT-45383
 #KT-45444
 #KT-45907
2021-04-20 21:24:29 +02:00

33 lines
405 B
Kotlin
Vendored

// KT-45286
// MODULE: lib
// WITH_RUNTIME
// FILE: A.kt
package a
import kotlin.coroutines.*
var result = "Fail"
fun f() {
result = "OK"
}
fun g(block: suspend () -> Unit) {
block.startCoroutine(Continuation(EmptyCoroutineContext) {
it.getOrThrow()
})
}
inline fun h() = g(::f)
// MODULE: main(lib)
// FILE: B.kt
package b
fun box(): String {
a.h()
return a.result
}