https://kotlinlang.org logo
j

jeggy

04/09/2020, 1:44 PM
Is it possible to know if a type is a sealed class from a
KType
? I've created a sample of what I'm trying to do: https://pl.kotl.in/zBHj3IlEi
d

diesieben07

04/09/2020, 2:12 PM
val isSealed = (returnType.classifier as? KClass<*>)?.isSealed ?: false
🎉 2
j

jeggy

04/09/2020, 2:55 PM
Thanks 🙂
4 Views