Package-level declarations

Types

Link copied to clipboard
data class ConcreteReturnTypeProperty1<T, V>(val property: KProperty1<T, V>, val concreteReturnType: KType)
Link copied to clipboard
Link copied to clipboard
data class TypeAndClass<T : Any>(val type: KType, val clazz: KClass<T> = type.classifier as KClass<T>)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

For GADTs, the subclasses whose type parameters failed to be inferred will be discarded.

Excluding those with star projections (and instantiated with type parameters).

Excluding those with star projections (and instantiated with type parameters).

Link copied to clipboard
fun concreteTypeUnify(knowConcreteType: KType, typeWithVariables: KType): Substitution?
Link copied to clipboard
Link copied to clipboard
fun inferSubclassType(subclass: KClass<*>, superclassTypeAndClass: TypeAndClass<*>): KType?
Link copied to clipboard
fun inferSubclassTypeThrowOnFailing(subclass: KClass<*>, superclassTypeAndClass: TypeAndClass<*>): KType
Link copied to clipboard
Link copied to clipboard

A concrete type is a simple type or a parametrized type. See https://kotlinlang.org/spec/type-system.html#type-kinds for its definition.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun KType.substitute(substitution: Substitution): KType
Link copied to clipboard

A useful utility function for debugging purposes. It produces the string produced by toString if the class were a data class with all public properties recursively. Note the data should not have cyclic references, otherwise the function call will not terminate. Note that if a class has an overriden toString method (for example a data class), it will be called directly, so if it contains a public property whose class doesn't have an overriden toString method the default Any.toString will be called.

Link copied to clipboard
inline fun <T : Any> typeAndClassOf(): TypeAndClass<T>