Gen Type Ref¶
Import: import system.codegen;
GenTypeRef¶
A resolved type with structured arguments and declaration identity.
kind¶
Shape of the type: primitive, named, array, tuple, function, type parameter, or unknown.
name¶
int, List, T, or empty for arrays/tuples/functions.
display¶
Display spelling, including canonical module qualification for resolved names.
mangled¶
Unique type spelling that distinguishes concrete generic instantiations; useful for generated names.
decl¶
Identity of the named declaration (::User, system.collections::List), or empty.
args¶
Type arguments; the element of an array; tuple members; function params then return.
constructor¶
Creates a GenTypeRef from its parts. Generators normally receive these from GenContext rather than constructing them.
public constructor(
kind: TypeRefKind,
name: string,
display: string,
mangled: string,
decl: string,
args: List<GenTypeRef>
)
unknown¶
A type of kind Unknown with no name or arguments, used where a type could not be inferred.
primitive¶
The scalar this type is, or Primitive.NotPrimitive.
is_primitive¶
Whether this type is the primitive scalar p.
collection¶
The standard collection this type is, or CollectionKind.NotCollection.
is_option¶
Whether this type is Option<T> for some T.
is_param¶
Whether this type is a generic type parameter such as T.
is_decl¶
True when this names the declaration decl_id (see declof).
arg¶
Type argument i, or an unknown type when there is none.
source_name¶
Renders a type using local declaration names in a scope that imports those declarations.
to_string¶
The display spelling of the type.