From d9a9bd0136f8097221aef1bb93cb1c911a206af4 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 15 Mar 2021 20:34:24 +0100 Subject: [PATCH] Fix compilation of Interop/Runtime after fc36178f3ae --- .../Runtime/src/jvm/kotlin/kotlinx/cinterop/JvmCallbacks.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kotlin-native/Interop/Runtime/src/jvm/kotlin/kotlinx/cinterop/JvmCallbacks.kt b/kotlin-native/Interop/Runtime/src/jvm/kotlin/kotlinx/cinterop/JvmCallbacks.kt index fd01e1fedee..ca6345b690e 100644 --- a/kotlin-native/Interop/Runtime/src/jvm/kotlin/kotlinx/cinterop/JvmCallbacks.kt +++ b/kotlin-native/Interop/Runtime/src/jvm/kotlin/kotlinx/cinterop/JvmCallbacks.kt @@ -25,6 +25,7 @@ import kotlin.reflect.full.companionObjectInstance import kotlin.reflect.full.declaredMemberProperties import kotlin.reflect.full.isSubclassOf import kotlin.reflect.jvm.reflect +import kotlin.reflect.jvm.ExperimentalReflectionOnLambdas internal fun createStablePointer(any: Any): COpaquePointer = newGlobalRef(any).toCPointer()!! @@ -164,6 +165,7 @@ private fun createStaticCFunction(function: Function<*>): CPointer> throw IllegalArgumentException(errorMessage) } + @OptIn(ExperimentalReflectionOnLambdas::class) val kFunction = function as? KFunction<*> ?: function.reflect() ?: throw IllegalArgumentException(errorMessage)