pub fn generic_record_is_recursive(
name: &str,
types: &HashMap<String, Arc<TypeDecl>>,
) -> boolExpand description
v0.174 (#592): does the generic record type name transitively contain a
reference to itself — through any field-type path, including collection and
Option wrappers, sum-variant payloads, and generic type arguments? Such a
type has no finite set of monomorphised boundary codecs: uniform recursion
(Node[T] = { next: Option[Node[T]] }) would need a self-referential codec
chain the per-instantiation model does not yet generate, and polymorphic
recursion (Weird[T] = { next: Option[Weird[List[T]]] }) an unbounded set of
instantiations. A recursive generic declares and works in memory; it is
refused only where a codec is required
(bynk.generics.recursive_generic_at_boundary, found by
recursive_generic_path), and polymorphic recursion is refused at its
declaration (bynk.generics.polymorphic_recursion, found by
polymorphic_recursion_edges).
Detection is reachability over the type-containment graph: name is
recursive iff it is reachable from its own body, following every named /
applied head and descending into every wrapper, map/result pair, function
position, and generic argument. Terminates via the visited set.