Reflection: add KClass.isInstance, KClass.cast, KClass.safeCast

#KT-11284 Fixed
This commit is contained in:
Alexander Udalov
2016-07-12 18:48:37 +03:00
parent 3702f4a7a7
commit ada81923dc
7 changed files with 136 additions and 3 deletions
@@ -58,6 +58,11 @@ public interface KClass<T : Any> : KDeclarationContainer, KAnnotatedElement, KCl
*/
public val objectInstance: T?
/**
* Returns `true` if [value] is an instance of this class on a given platform.
*/
public fun isInstance(value: Any?): Boolean
/**
* The list of type parameters of this class. This list does *not* include type parameters of outer classes.
*/