FunctionParameter

data class FunctionParameter(val modifiers: List<Node.Modifier>, val valOrVarKeyword: Node.Keyword.ValOrVarKeyword?, val name: Node.Expression.NameExpression, val type: Node.Type?, val defaultValue: Node.Expression?, val supplement: NodeSupplement = NodeSupplement()) : Node, Node.WithModifiers

AST node that represents a formal function parameter of a function declaration. For example, x: Int in fun f(x: Int) is a function parameter. The node corresponds to KtParameter inside KtNamedFunction.

Constructors

Link copied to clipboard
constructor(modifiers: List<Node.Modifier>, valOrVarKeyword: Node.Keyword.ValOrVarKeyword?, name: Node.Expression.NameExpression, type: Node.Type?, defaultValue: Node.Expression?, supplement: NodeSupplement = NodeSupplement())

Properties

Link copied to clipboard

list of annotation sets.

Link copied to clipboard

default value of the parameter if exists, otherwise null.

Link copied to clipboard
open override val modifiers: List<Node.Modifier>

list of modifiers.

Link copied to clipboard

name of the parameter.

Link copied to clipboard
open override val supplement: NodeSupplement

Supplemental data for the node.

Link copied to clipboard

type of the parameter. Can be null for anonymous function parameters.

Link copied to clipboard

val or var keyword if exists, otherwise null.