sealedSubclassInstances

inline fun <T : Any> KClass<T>.sealedSubclassInstances(vararg args: Any?): Sequence<T>(source)

Provides a sequence of instances of all non-abstract, non-sealed subclasses of the sealed class or interface that implement this KClass. The instances are created using the primary constructor of each subclass, with the provided arguments.

Return

A Sequence of instances of all descendant classes.

Parameters

args

The arguments to be passed to the primary constructor of each subclass.