Skip to content

KaSymbolOrigin

KaSymbolOrigin describes the kind of data source (sources, libraries, etc.) or generation (SAM constructors, compiler plugins, etc.) the symbol originates from.

In cases where the origin is a generated declaration (e.g. SAM_CONSTRUCTOR, DELEGATED, JAVA_SYNTHETIC_PROPERTY), not only the generated declaration itself will have this origin, but all declarations contained in it as well. For example, while KaSamConstructorSymbol has a SAM_CONSTRUCTOR origin, its value parameters also share the same SAM_CONSTRUCTOR origin.

Entries

SOURCE

A declaration directly written in Kotlin source code.

SOURCE_MEMBER_GENERATED

A declaration generated by the Kotlin compiler as a member of another declaration, such as:

LIBRARY

A declaration from a compiled Kotlin library (.jar or .klib files).

JAVA_SOURCE

A declaration from Java source code.

JAVA_LIBRARY

A declaration from a compiled Java library.

SAM_CONSTRUCTOR

A declaration from a synthetic constructor function used to build instances of SAM interfaces.

TYPEALIASED_CONSTRUCTOR

A declaration from a type alias constructor. Class type aliases define their own synthetic constructors which can be called in place of the original class's constructor.

INTERSECTION_OVERRIDE

A declaration from a synthetic callable generated by the Kotlin compiler for callable intersections.

SUBSTITUTION_OVERRIDE

A declaration from a synthetic callable generated by the Kotlin compiler for callable type substitutions.

DELEGATED

A declaration from a member generated by the compiler for interface delegation. This occurs when a class delegates the implementation of an interface to another object.

JAVA_SYNTHETIC_PROPERTY

A declaration from a synthetic property generated by the compiler for a Java field associated with a getter or setter. This allows Java fields to be accessed like Kotlin properties.

PROPERTY_BACKING_FIELD

The backing field of a property declaration (a field that stores the value of the property).

PLUGIN

A declaration generated by a compiler plugin.

JS_DYNAMIC

A declaration from a dynamic Kotlin/JS scope.

NATIVE_FORWARD_DECLARATION

A Kotlin/Native forward declaration.

Companion properties

entries

Returns an immutable kotlin.enums.EnumEntries list containing the constants of this enum type, in the order they're declared.

Companion functions

valueOf

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws

kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using entries property as a more efficient alternative returning an immutable list of enum entries.

Properties

name

val name: String

ordinal

val ordinal: Int