Skip to main content

Module json_strategy

Module json_strategy 

Source
Expand description

JSON.parse union-target strategy resolver.

Structs§

JsonUnionStrategy

Enums§

JsonNarrowReason
ObjectDispatch
PerTagStrategy
PrimBase
Booleans excluded — no BooleanLiteral in the type system.

Functions§

resolve_json_union_strategy
Preconditions: every member is a valid JSON.parse target (no Unknown, Function, InterfaceRef, etc.) and the union is canonical (sorted, deduplicated, flattened, no Never/Error).
resolve_json_union_strategy_with
Like resolve_json_union_strategy but classifies recursion back-edges (Type::AliasRef) by expanding them one level via expand.

Type Aliases§

AliasExpander
One-level expander for recursion back-edges. Given a Type::AliasRef, returns the alias body (peeled, args substituted); for any other type returns ty.peel() cloned. Lets the union resolver classify a recursive member by its underlying JSON kind without the resolver itself owning the type namespace.