TypeAnnotationKind

enum TypeAnnotationKind

The 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 unique([TypeAnnotation])

*T: a uniquely-owned value; inner 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(String, Int, Int, [GenericArg])

The name, its token span (-1 = implied, e.g. the [T] sugar's Array head), and the generic arguments.

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).