1

I keep running into the error in the title whenever I use most of the functions for KClass that involve two different classes (isSubclass(), isSuperclass(), and even .superclasses.forEach {}) whenever I run it in InteliJ

I've already tried the solution detailed here, and even tried updating the kotlin-runtime dependency they said to include to version 1.2.0 (1.3.0+ don't exist)

class EditorObject(base: KClass<*>,test: KClass<*>) {

    init {
        if(!base.isSuperclassOf(test)){
            println("${AnsiColor.YELLOW}WARNING: Non-BaseObjects are not supported.${AnsiColor.RESET}")
            println("test")
        }
        println("got here")
        val init = base.primaryConstructor

    }
}

Only crashes if base!=test.

Bastian_5
  • 51
  • 4

0 Answers0