Add KClass.sealedSubclasses to get direct subclasses of sealed class

#KT-14657 Fixed
This commit is contained in:
Alexander Udalov
2018-08-03 13:23:53 +02:00
committed by Ilya Gorbunov
parent 1b1713a849
commit cbc92bc9a1
12 changed files with 95 additions and 0 deletions
@@ -76,6 +76,12 @@ public interface KClass<T : Any> : KDeclarationContainer, KAnnotatedElement, KCl
@SinceKotlin("1.1")
public val supertypes: List<KType>
/**
* The list of the immediate subclasses if this class is a sealed class, or an empty list otherwise.
*/
@SinceKotlin("1.3")
public val sealedSubclasses: List<KClass<out T>>
/**
* Visibility of this class, or `null` if its visibility cannot be represented in Kotlin.
*/