ParameterDescriptor

sealed class ParameterDescriptor

A parameter of an exported FunctionDescriptor.

Sealed so that each variant represents a distinct contribution to the wrapper:

  • Plain maps 1:1 to the source function's parameter list;

  • Spread expands a class type into one wrapper parameter per constructor member and rebuilds the instance at the delegation call site.

The code generator flat-maps every parameter to its Plain contributions when assembling the wrapper's signature and switches on the concrete variant when assembling the delegation.

Inheritors

Types

Link copied to clipboard
data class Plain(val originalName: String, val exportedName: String, val type: KSType, val defaultExpression: String?, val sourceAnnotations: String?) : ParameterDescriptor

A plain parameter: exactly one entry in the source function's parameter list, exactly one entry in the wrapper's parameter list.

Link copied to clipboard
data class Spread(val originalName: String, val dataClassFqn: String, val components: List<ParameterDescriptor.Plain>, val sourceAnnotations: String?, val dataClassKdoc: String?) : ParameterDescriptor

A spread parameter: the source function declared one parameter of a class type marked with @Spread; the wrapper exposes one Plain per primary-constructor member of that class and reconstructs an instance via named-argument constructor invocation at the delegation.

Properties

Link copied to clipboard
abstract val originalName: String

Kotlin parameter name on the source function (the name used as the delegation argument label).

Link copied to clipboard
abstract val sourceAnnotations: String?

Verbatim source text of parameter-level annotations to propagate to the wrapper, or null when none apply.