Add KClass.isFun modifier to reflection

#KT-38881 Fixed
This commit is contained in:
Alexander Udalov
2020-05-12 20:50:01 +02:00
parent 86b5c63891
commit 82551e91a4
7 changed files with 43 additions and 14 deletions
@@ -77,6 +77,10 @@ public class ClassReference(override val jClass: Class<*>) : KClass<Any>, ClassB
override val isCompanion: Boolean
get() = error()
@SinceKotlin("1.4")
override val isFun: Boolean
get() = error()
private fun error(): Nothing = throw KotlinReflectionNotSupportedError()
override fun equals(other: Any?) =
@@ -127,6 +127,12 @@ public actual interface KClass<T : Any> : KDeclarationContainer, KAnnotatedEleme
@SinceKotlin("1.1")
public val isCompanion: Boolean
/**
* `true` if this class is a Kotlin functional interface.
*/
@SinceKotlin("1.4")
public val isFun: Boolean
/**
* Returns `true` if this [KClass] instance represents the same Kotlin class as the class represented by [other].
* On JVM this means that all of the following conditions are satisfied:
@@ -3450,6 +3450,7 @@ public final class kotlin/jvm/internal/ClassReference : kotlin/jvm/internal/Clas
public fun isCompanion ()Z
public fun isData ()Z
public fun isFinal ()Z
public fun isFun ()Z
public fun isInner ()Z
public fun isInstance (Ljava/lang/Object;)Z
public fun isOpen ()Z
@@ -4593,6 +4594,7 @@ public abstract interface class kotlin/reflect/KClass : kotlin/reflect/KAnnotate
public abstract fun isCompanion ()Z
public abstract fun isData ()Z
public abstract fun isFinal ()Z
public abstract fun isFun ()Z
public abstract fun isInner ()Z
public abstract fun isInstance (Ljava/lang/Object;)Z
public abstract fun isOpen ()Z