Optimistically add isInstance and qualifiedName to common KClass
Because they are used in common cast and safeCast functions
This commit is contained in:
@@ -24,7 +24,7 @@ public actual interface KClass<T : Any> : KDeclarationContainer, KAnnotatedEleme
|
||||
* The fully qualified dot-separated name of the class,
|
||||
* or `null` if the class is local or it is an anonymous object literal.
|
||||
*/
|
||||
public val qualifiedName: String?
|
||||
public actual val qualifiedName: String?
|
||||
|
||||
/**
|
||||
* All functions and properties accessible in this class, including those declared in this class
|
||||
@@ -51,7 +51,7 @@ public actual interface KClass<T : Any> : KDeclarationContainer, KAnnotatedEleme
|
||||
* Returns `true` if [value] is an instance of this class on a given platform.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public fun isInstance(value: Any?): Boolean
|
||||
public actual fun isInstance(value: Any?): Boolean
|
||||
|
||||
/**
|
||||
* The list of type parameters of this class. This list does *not* include type parameters of outer classes.
|
||||
|
||||
@@ -19,4 +19,17 @@ public expect interface KClass<T : Any> {
|
||||
* or `null` if the class has no name (if, for example, it is an anonymous object literal).
|
||||
*/
|
||||
public val simpleName: String?
|
||||
|
||||
/**
|
||||
* The fully qualified dot-separated name of the class,
|
||||
* or `null` if the class is local or it is an anonymous object literal.
|
||||
*/
|
||||
public val qualifiedName: String?
|
||||
|
||||
/**
|
||||
* Returns `true` if [value] is an instance of this class on a given platform.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public fun isInstance(value: Any?): Boolean
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user