
org.ufoss.kotysa.Reflection.kt Maven / Gradle / Ivy
/*
* This is free and unencumbered software released into the public domain, following
*/
package org.ufoss.kotysa
import kotlin.reflect.KCallable
import kotlin.reflect.KFunction
import kotlin.reflect.KProperty1
public fun ((T) -> Any?).toCallable(): KCallable =
when (this) {
is KProperty1 -> this
is KFunction<*> -> this
else -> throw RuntimeException("Wrong type for $this, support only KProperty1 and KFunction")
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy