enum TypeAnnotationKindThe grammar form and recursively parsed components of a type annotation.
Recursive single children use one-element arrays to keep plain-value layouts finite. Name and member cases retain token spans and explicit generic arguments; no name resolution or alias expansion has happened yet.
Cases
case borrow(Bool, [TypeAnnotation])
mutable, inner as a one-element array.
case unique([TypeAnnotation])
*T: a uniquely-owned value; inner as a one-element array.
case func_type([TypeAnnotation], EffectSet, [TypeAnnotation])
Parameters (borrow-by-default already applied), effects, and the return type as a one-element array.
case quantified_type([GenericDecl], WhereClause?, [TypeAnnotation])
A quantified function type <T, U: Bound>(params) -> Ret (rank-N field types): declared generics, the optional where clause, and the inner function type as a one-element array.
case nominal_path([TypeAnnotation], String, Int, Int, [GenericArg])
The base as a one-element array, then the member name, its token span, and its explicit generic arguments.
case nominal(String, Int, Int, [GenericArg])
The name, its token span (-1 = implied, e.g. the [T] sugar's Array head), and the generic arguments.
case tuple([TypeAnnotation])
An ordered tuple of element types.
case record_type([RecordFieldTypeAnnotation])
A structural record type with labeled fields.
case any_type([TypeAnnotation], [AnyAssocBinding])
The protocol head as a one-element array, then Assoc = T bindings.
case macro_call_type(String, Int, Int, Int, Int, [MacroToken])
An @macro invocation in type position: name + its token span, the input extent, and canonical tokens (outer delimiters included).