KaNamedClassSymbol
Represents a named class, object, or interface declaration. Basically, covers all class-like declarations, excluding anonymous objects.
Use Cases
Checking for specific class features. Use properties like
isData,isInner, andisCompanionto determine if the class has specific characteristics.
Also see use cases for the KaClassSymbol supertype.
Hierarchy
Inherits from KaClassSymbol.
Members
val name: NameThe simple declaration name, e.g.,
Stringforkotlin.String.val companionObject: KaNamedClassSymbol?The nested companion object, or
nullif there is no companion object.val contextReceivers: List<KaContextReceiver>A list of context receivers.
Experimental API.
val isExternal: Booleantrueif the declaration has theexternalmodifier.val isData: Booleantrueif the declaration is adata class.val isInline: Booleantrueif the declaration is aninline class.val isFun: Booleantrueif the declaration is afun interface.val isInner: Booleantrueif the declaration is an inner class.val typeParameters: List<KaTypeParameterSymbol>A list of declared type parameters.
Type utilities
val KaNamedClassSymbol.defaultType: KaTypeA class type where type parameters are substituted with matching type parameter types, e.g.,
List<T>for theListclass.
Relation utilities
val KaNamedClassSymbol.sealedClassInheritors: List<KaNamedClassSymbol>Inheritors of the given sealed class.