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

org.jetbrains.kotlinx.jupyter.util.Reflecton.kt Maven / Gradle / Ivy

There is a newer version: 0.12.0-335
Show newest version
package org.jetbrains.kotlinx.jupyter.util

import kotlin.reflect.KClass
import kotlin.reflect.full.isSubclassOf
import kotlin.reflect.jvm.internal.KotlinReflectionInternalError

fun KClass<*>.isSubclassOfCatching(superType: KClass<*>): Boolean {
    return try {
        isSubclassOf(superType)
    } catch (e: UnsupportedOperationException) {
        false
    } catch (e: KotlinReflectionInternalError) {
        false
    } catch (e: InternalError) {
        // Workaround for #341
        false
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy