A function definition, using a block.
Exampes (multi-line):
shared void run() { print("Hello, `` process.arguments.first else "World" ``!"); } shared actual Boolean equals(Object that) { if (is Color that) { return red == that.red && green == that.green && blue == that.blue; } else { return false; } }
no subtypes hierarchy
Initializer |
FunctionDefinition(LIdentifier name, Type|VoidModifier|FunctionModifier|DynamicModifier type, [Parameters+] parameterLists, Block definition, TypeParameters? typeParameters = null, TypeConstraint[] typeConstraints = [], Annotations annotations = ...) Parameters:
|
Attributes | |
annotations | Source Codeshared actual Annotations annotations The annotations on the declaration. Refines Declaration.annotations |
children | Source Codeshared actual [Annotations, Type|FunctionModifier|DynamicModifier|VoidModifier, LIdentifier, <TypeParameters|Parameters|TypeConstraint|Block>*] children The child nodes of this node. |
definition | Source Codeshared actual Block definition The definition of the declaration, if present. |
hash | Source Codeshared actual Integer hash The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that:
Therefore, a class which refines In general, Note that when executing on a Java Virtual Machine, the
64-bit Refines Object.hash |
name | Source Codeshared actual LIdentifier name The name of the declared program element, if present. |
parameterLists | Source Codeshared actual [Parameters+] parameterLists The parameter lists. A function must have at least one, but may also have several parameter lists. Refines AnyFunction.parameterLists |
type | Source Codeshared actual Type|VoidModifier|FunctionModifier|DynamicModifier type The type of the function. This can be:
|
typeConstraints | Source Codeshared actual TypeConstraint[] typeConstraints The type constraints placed upon the function’s type parameters, if any. Refines AnyFunction.typeConstraints |
typeParameters | Source Codeshared actual TypeParameters? typeParameters The type parameters of the function, if any. Refines AnyFunction.typeParameters |
Inherited Attributes |
Attributes inherited from: AnyFunction |
Attributes inherited from: Declaration |
Attributes inherited from: Node |
Attributes inherited from: Object hash , string |
Attributes inherited from: TypedDeclaration |
Methods | |
copy | Source Codeshared FunctionDefinition copy(LIdentifier name = ..., Type|VoidModifier|FunctionModifier|DynamicModifier type = ..., [Parameters+] parameterLists = ..., Block definition = ..., TypeParameters? typeParameters = ..., TypeConstraint[] typeConstraints = ..., Annotations annotations = ...) Parameters:
|
equals | Source Codeshared actual Boolean equals(Object that) Determine if two values are equal. For any two non-null objects x == y Implementations should respect the constraints that:
Furthermore it is recommended that implementations
ensure that if A class which explicitly refines Note that an implementation of Refines Object.equals |
transform | Source Codeshared actual Result transform<out Result>(Transformer<Result> transformer) Transform this node with the given If you have a Refines Node.transform |
visit | Source Codeshared actual void visit(Visitor visitor) Visit this node with the given Refines Node.visit |
Inherited Methods |
Methods inherited from: Node |
Methods inherited from: Object equals |