diff --git a/libraries/stdlib/src/kotlin/util/JLangJVM.kt b/libraries/stdlib/src/kotlin/util/JLangJVM.kt index c1a7f560a4d..135a654688d 100644 --- a/libraries/stdlib/src/kotlin/util/JLangJVM.kt +++ b/libraries/stdlib/src/kotlin/util/JLangJVM.kt @@ -1,5 +1,6 @@ package kotlin +import java.lang.reflect.Method import kotlin.jvm.internal.unsafe.* import kotlin.jvm.internal.Intrinsic import kotlin.reflect.KClass @@ -58,3 +59,11 @@ public inline fun synchronized(lock: Any, block: () -> R): R { */ public fun T.annotationType() : Class = (this as java.lang.annotation.Annotation).annotationType() as Class + +/** + * Invokes the underlying method represented by this [Method] object, on the specified [instance] with the specified parameters. + */ +@Suppress("NOTHING_TO_INLINE") +public inline fun Method.invoke(instance: Any, vararg args: Any?): Any? { + return invoke(instance, *args) +} \ No newline at end of file