Reflection: add KClass.{supertypes,superclasses,allSupertypes,allSuperclasses}

Some things are not implemented yet for allSupertypes, such as KType->Type
mapping of types and generic substitution of built-in types
This commit is contained in:
Alexander Udalov
2016-07-12 18:42:46 +03:00
parent 486ea62c72
commit 4cd252d9d5
9 changed files with 262 additions and 4 deletions
@@ -16,10 +16,7 @@
package kotlin.jvm.internal
import kotlin.reflect.KCallable
import kotlin.reflect.KClass
import kotlin.reflect.KFunction
import kotlin.reflect.KTypeParameter
import kotlin.reflect.*
class ClassReference(override val jClass: Class<*>) : KClass<Any>, ClassBasedDeclarationContainer {
override val simpleName: String?
@@ -46,6 +43,9 @@ class ClassReference(override val jClass: Class<*>) : KClass<Any>, ClassBasedDec
override val typeParameters: List<KTypeParameter>
get() = error()
override val supertypes: List<KType>
get() = error()
private fun error(): Nothing = throw KotlinReflectionNotSupportedError()
override fun equals(other: Any?) =