GenDecl¶
Import: import system.codegen;
GenDecl¶
A class, struct, union, enum or interface the generator's triggers selected.
id¶
Identity of this model node; pass it to GenContext.error_at to report a diagnostic here.
name¶
Unqualified declaration name (User).
kind¶
Whether this declares a class, struct, union, enum, or interface.
module_name¶
Fully qualified module containing the declaration.
visibility¶
Declared access level of this symbol.
location¶
Where the declaration is written in source.
generics¶
Names of the declared type parameters, in order.
interfaces¶
Interfaces implemented by the declaration.
attributes¶
Attributes attached to this declaration.
fields¶
Fields of this type, in declaration order.
methods¶
Methods declared by this type.
variants¶
Choices declared by this union or enum, in declaration order.
constructor¶
Creates a GenDecl from its parts. Generators normally receive these from GenContext rather than constructing them.
public constructor(
id: string,
name: string,
kind: DeclKind,
module_name: string,
visibility: string,
location: GenLocation,
generics: List<string>,
interfaces: List<GenTypeRef>,
attributes: List<GenAttribute>,
fields: List<GenField>,
methods: List<GenFunction>,
variants: List<GenVariant>
)
attribute¶
The first @A attached to this declaration, decoded into A, or None when absent.
has¶
Whether this declaration carries at least one @A attribute.
self_type¶
Name or Name<T, U>: the spelling of this type inside its own generic scope.