Expand description
Type registry for tracking user-defined types during parsing.
The registry stores type definitions discovered during the discovery pass and provides lookup during parsing and code generation. It supports:
- Primitives: Nat, Int, Text, Bool (built-in)
- Structs: Named records with typed fields
- Enums: Sum types with variants (unit or tuple)
- Generics: Parameterized types (List of T, Pair of T and U)
The registry is populated by super::DiscoveryPass before main parsing begins.
Structs§
- Field
Def - Field definition within a struct
- Type
Registry - Variant
Def - Phase 33: Variant definition for sum types
Enums§
Constants§
- BUILTIN_
STRUCT_ NAMES - The structs the compiler hands to author code fully formed, rather than one an
## An X has:declaration writes — the one listTypeRegistry::with_primitivesregisters them from andTypeRegistry::is_builtin_structanswers against, so a consumer never has to know their names itself.crates/logicaffeine_compile/src/vm/wasm/kind.rs’sbuiltin_struct_types()carries the same two shapes for the wasm backend’s own boundary-type resolution.
Functions§
- builtin_
generic_ param_ count - How many type parameters a BUILT-IN generic takes — the one table the whole compiler asks.