All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.com.huanshankeji.kotlin.reflect.Sealed.kt Maven / Gradle / Ivy

The newest version!
package com.huanshankeji.kotlin.reflect

import kotlin.reflect.KClass

// This implementation currently has poor performance (O(depth * size) time complexity).
fun  KClass.sealedLeafSubclasses(): List> =
    if (isSealed) sealedSubclasses.flatMap { it.sealedLeafSubclasses() }
    else listOf(this)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy