Expand description
AST-based type inference for Plotnik queries.
Analyzes query AST to determine output types. Rules follow ADR-0009 (Type System).
§Design
Unlike graph-based inference which must reconstruct structure from CFG traversal, AST-based inference directly walks the tree structure:
- Sequences →
SeqExpr - Alternations →
AltExprwith.kind()for tagged/untagged - Quantifiers →
QuantifiedExpr - Captures →
CapturedExpr
This eliminates dry-run traversal, reconvergence detection, and scope stack management.
Structs§
- Inferred
Member - A field (for Record) or variant (for Enum).
- Inferred
Type Def - An inferred type definition.
- Type
Inference Result - Result of type inference.
- Unification
Error - Error when types cannot be unified in alternation branches.
Enums§
- Type
Description - Human-readable type description for error messages.