A function declaration.
A function declaration declares the name
, type
, parameters,
type parameters and type constraints of the value,
but doesn’t provide a definition
for it. There are several possible reasons for this:
formal
method of an abstract
class or an interface,
and subtypes have to provide the definition.In any case, the declaration must explicitly specify a type;
a ‘function
’ modifier (FunctionModifier
) indicating type inference cannot be used.
(The ’dynamic
’ modifier counts as a “type” here, indicating
not the inference, but rather the absense of typing information.)
no subtypes hierarchy
Initializer |
FunctionDeclaration(MemberName name, Type|VoidModifier|FunctionModifier|DynamicModifier type, [Parameters+] parameterLists, TypeParameters? typeParameters = null, TypeConstraint[] typeConstraints = [], Annotations annotations = ...) Parameters:
|
Attributes | |
annotations | shared actual Annotations annotations The annotations on the declaration. Refines Declaration.annotations |
children | shared actual [Annotations, Type|VoidModifier|FunctionModifier|DynamicModifier, LIdentifier, <TypeParameters|Parameters|TypeConstraint>*] children The child nodes of this node. |
definition | shared actual Null definition A function declaration has no definition. |
hash | shared 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 | shared actual MemberName name The name of the declared program element, if present. |
parameterLists | shared actual [Parameters+] parameterLists The parameter lists. A function must have at least one, but may also have several parameter lists. Refines AnyFunction.parameterLists |
type | shared actual Type|VoidModifier|FunctionModifier|DynamicModifier type The type of the declared function. This can be:
|
typeConstraints | shared actual TypeConstraint[] typeConstraints The type constraints placed upon the function’s type parameters, if any. Refines AnyFunction.typeConstraints |
typeParameters | shared 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 | shared FunctionDeclaration copy(MemberName name = ..., Type|VoidModifier|FunctionModifier|DynamicModifier type = ..., [Parameters+] parameterLists = ..., TypeParameters? typeParameters = ..., TypeConstraint[] typeConstraints = ..., Annotations annotations = ...) Parameters:
|
equals | shared actual Boolean equals(Object that) Determine if two values are equal. 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 | shared actual Result transform<out Result>(Transformer<Result> transformer) Transform this node with the given If you have a Refines Node.transform |
visit | shared 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 |