Skip to main content

Module resolve

Module resolve 

Source
Expand description

Type-Resolution + Recursion-Guards (XTypes §7.3.4.5, §7.3.4.9).

Cross-references between TypeObjects happen via EquivalenceHash TypeIdentifiers (EK_MINIMAL / EK_COMPLETE). A TypeRegistry map caches known objects; resolver functions follow alias chains and detect recursion/cycles/DoS attempts via a depth cap.

Structs§

TypeRegistry
In-memory registry of known TypeObjects, indexed by EquivalenceHash. Typically populated by TypeLookup replies.

Enums§

ResolveError
Error during type resolution.

Constants§

DEFAULT_MAX_RESOLVE_DEPTH
Maximum depth for recursively resolving alias chains and TypeIdentifier references. Prevents DoS via malicious type graphs with cycles.
DEFAULT_MAX_RESOLVE_NODES
Maximum number of nodes during collect_referenced_hashes. In addition to the depth cap this also bounds wide/fan-out-heavy graphs (a struct with 10,000 member entries that all reference hashes).

Functions§

collect_referenced_hashes
Collects transitively all EquivalenceHash TypeIdentifiers that are referenced by root directly or indirectly (through collections, struct members, union cases, alias targets). Useful for TypeLookup dependency resolution (T14).
resolve_alias_chain
Follows alias chains: if ti references an alias (and the alias is known in the registry), resolve to the related_type. Primitive / plain / hash-direct are returned unchanged.