GenFunction¶
Import: import system.codegen;
GenFunction¶
A method, or a top-level function.
id¶
Identity of this model node; pass it to GenContext.error_at to report a diagnostic here.
overload¶
Identifier distinguishing this function's overload.
name¶
Function or method name as declared.
is_static¶
Whether the member belongs to the type rather than an instance.
is_async¶
Whether this function returns an asynchronous result.
visibility¶
Declared access level of this symbol.
generics¶
Names of the declared type parameters, in order.
params¶
Function parameters in declaration order.
ret¶
Declared return type of the function.
attributes¶
Attributes attached to this declaration.
location¶
Where the function is written in source.
body¶
Function body, when source is available.
constructor¶
Creates a GenFunction from its parts. Generators normally receive these from GenContext rather than constructing them.
public constructor(
id: string,
name: string,
is_static: bool,
is_async: bool,
visibility: string,
generics: List<string>,
params: List<GenParam>,
ret: GenTypeRef,
attributes: List<GenAttribute>,
location: GenLocation,
body: Option<GenBody>,
overload: string
)
attribute¶
The first @A attached to this function, decoded into A, or None when absent.
has¶
Whether this function carries at least one @A attribute.