Skip to main content

GenericDeclRegistry

Type Alias GenericDeclRegistry 

Source
pub type GenericDeclRegistry = HashMap<String, Vec<GenericParam>>;
Expand description

Maps a generic type’s declared name to its generic parameters. Built by a pre-scan of every RecordDecl/EnumDecl/ClassDecl across the reached modules.

Backends with native generic-receiver / impl syntax (Rust impl<T> T<T>, Go func (self *T[T]), TS declaration-merged interface T<T>) need a generic type’s parameters at its method-emission site even though the AIR impl Box { ... } block carries no generic params of its own — the T is declared on the record, not the impl. This registry recovers those params at the impl site. A pre-scan (rather than recording params as decls are emitted) is required because an impl may precede its type’s declaration in source order, and because a used type’s decl can live in a different module than its impl (cross-module use). Mirrors collect_enum_variants.

Aliased Type§

pub struct GenericDeclRegistry { /* private fields */ }