Skip to main content

first_undeclared_type

Function first_undeclared_type 

Source
pub fn first_undeclared_type(
    stmts: &[Stmt<'_>],
    registry: &TypeRegistry,
    interner: &Interner,
) -> Option<(Option<usize>, Symbol)>
Expand description

The first type the program names that nothing supplies, with where it is named: the index of the top-level statement that names it, or None for a field of a declared record or variant (a declaration is not a statement). A name is supplied by the registry (a record, enum or alias the program declares or imports, a builtin, an intrinsic generic), by the language itself (codegen::types::is_language_type_name, and the dimension words Quantity of <Dimension> takes, Dimension::by_name), or as a type parameter the declaration itself introduces. Run on the program the parser returned, whose top-level statements align with its statement spans, so a statement’s refusal is located. A written type counts wherever it stands: a construction, a collection’s element type, an annotation, a typed fetch, a function’s parameters and return type, a record’s or variant’s field types.