JVM: Suspend converted references inherit AdaptedFunctionReference
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.reflect.KCallable
|
||||
|
||||
private fun check(label: String, fn: Any) {
|
||||
if (fn is KCallable<*>) {
|
||||
throw AssertionError("$label is KCallable, ${fn::class.java.simpleName}")
|
||||
}
|
||||
}
|
||||
|
||||
fun checkSuspend(label: String, fn: suspend () -> Unit) = check(label, fn)
|
||||
fun checkSuspendAny(label: String, fn: suspend () -> Any) = check(label, fn)
|
||||
|
||||
fun withSuspendConversion() {}
|
||||
|
||||
class CCtorAsSuspend()
|
||||
|
||||
fun box(): String {
|
||||
checkSuspend("::withSuspendConversion", ::withSuspendConversion)
|
||||
checkSuspendAny("::CCtorAsSuspend", ::CCtorAsSuspend)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user