crates.sage_ir.types
27 anchors
| Anchor | Implementation | Tests |
|---|---|---|
| crates.sage_ir.types (27) | 16 Implemented12 TODO | 13 Implemented27 TODO |
| crates.sage_ir.types.aliases (2) | 1 Implemented1 TODO | 1 Implemented2 TODO |
identity | Implemented | ImplementedTODO |
Named, associated, and opaque aliases retain their definition identity and generic arguments as one semantic type family across copy, fold, display, inference, canonical queries/responses, and oracle emission. A debug-formatted string is not a semantic rigid or alias type. | ||
revelation | TODO | TODO |
Normalization is explicit. Completed IR need not erase every alias: named aliases reveal their substituted right-hand sides, associated projections normalize through trait solving, and opaque aliases reveal only inside their definition boundary or a future code-generation phase. An unrevealed alias retains provable declared bounds and can be related structurally by identity and arguments. | ||
| crates.sage_ir.types.binder (1) | 1 Implemented1 TODO | 1 Implemented1 TODO |
owner_parameters | ImplementedTODO | ImplementedTODO |
Opening an associated signature reuses the owning trait or impl’s Self and generic parameter identities before introducing the associated item’s own parameters. A Binder pairs its value with the parameters binding references in that value; copying or opening it does not mint replacements for those identities. | ||
| crates.sage_ir.types.body (13) | 4 Implemented9 TODO | 3 Implemented13 TODO |
await | TODO | TODO |
Await remains a high-level operation over an explicitly resolved IntoFuture conversion and Future::Output type; it does not contain polling, suspension-point, or state-machine lowering. | ||
closures | TODO | TODO |
A completed closure has a typed nested body with explicit parameters and captures. | ||
conditional_patterns | TODO | TODO |
If-let, while-let, and let chains lower into structured match and control-flow forms. | ||
coroutines | TODO | TODO |
An async block or async function has a typed nested coroutine body. Typed IR does not lower it into a generator state machine. | ||
diagnosed_recovery | Implemented | ImplementedTODO |
A recovery body represents failure using explicit error nodes backed by diagnostics, never an unresolved choice presented as an ordinary successful node. | ||
elaborated | TODO | ImplementedTODO |
Completed bodies consume method syntax and temporary adjustment recipes. Implicit borrows, dereferences, and coercions are explicit typed nodes; successful output contains no source-shaped placeholder for an unresolved operation. Structured control flow remains a tree, without basic blocks, a drop schedule, generator lowering, or borrow-check results. | ||
for_iteration | TODO | TODO |
A for expression lowers into an IntoIterator call followed by a structured loop and match. | ||
indexing | TODO | TODO |
Index syntax lowers to a resolved Index or IndexMut call with typed operands. | ||
macro_expansion | TODO | TODO |
A checked expression represents its macro expansion output; a macro invocation is not itself a successful checked expression node. | ||
no_inference | Implemented | ImplementedTODO |
No live inference variable or unresolved semantic choice survives in a successful completed body. Completion resolves type edges and produces the final tree independently of temporary inference state. | ||
resolved_references | Implemented | TODO |
Every path, field, variant, function, and associated-item reference in a successful completed body records its resolved definition identity. | ||
try_residual | TODO | TODO |
The question-mark operator lowers into a Try::branch call, a ControlFlow match, and a FromResidual call. | ||
typed_provenance | Implemented | TODO |
Every expression and pattern in a successful completed body has a type and source provenance, including nodes synthesized from a source expression. | ||
| crates.sage_ir.types.calls (2) | 1 Implemented1 TODO | 1 Implemented2 TODO |
dispatch_families | TODO | TODO |
Completed calls distinguish direct function definitions, statically dispatched trait methods, dynamic trait-object methods, function pointers, and callable-trait dispatch through Fn, FnMut, or FnOnce. Receiver/coercion operations are already explicit tree nodes, not a replayable adjustment list. | ||
selected_semantics | Implemented | ImplementedTODO |
A completed call records the selected function, dispatch family, owner substitutions, and method substitutions. Trait-method calls retain Self and the selected trait reference; the proof justifying a call need not return a concrete impl identity. | ||
| crates.sage_ir.types.lifetimes (2) | 2 Implemented | 2 Implemented2 TODO |
dummy | Implemented | ImplementedTODO |
Every explicit, elided, universal, existential, imported, and synthesized lifetime lowers to Dummy. Dummy is neither static, a lifetime inference variable, nor post-analysis region erasure, and this deliberate omission does not create ambiguity. | ||
unchecked_borrows | Implemented | ImplementedTODO |
Outlives(Dummy, Dummy) holds. Reference and dereference operations remain explicit because they affect ordinary types, while Sage does not check borrow liveness, uniqueness, overlap, or validity. | ||
| crates.sage_ir.types.operators (2) | 2 Implemented | 1 Implemented2 TODO |
lazy_control_flow | Implemented | TODO |
Non-overloadable && and || remain explicit lazy logical operations whose right-hand side is conditionally evaluated; they do not become eager trait-method calls. | ||
trait_calls | Implemented | ImplementedTODO |
Every proven overloadable operator in completed Typed IR is a resolved trait-method call, whether its operands are primitive, generic, or user-defined. The call retains method identity, substitutions, explicit adjustments, and result type; no overloadable case completes as Binary. Primitive recognition belongs to later codegen with concrete substitutions. | ||
scoped_identities | Implemented | TODO |
Generic parameters use their own source-backed, external, or alpha-equivalent identity family. A field is identified by its owner plus field index, and a local by its body-local ID; these are not global Symbol variants. Semantic values retain these scoped identities. | ||
| crates.sage_ir.types.spans (4) | 4 Implemented | 4 Implemented4 TODO |
generated_identity | Implemented | ImplementedTODO |
Each generated parse source is identified by stable source input, generating operation, and occurrence, while generated text and current origin coordinates are mutable facts. Moving the origin must not collapse distinct occurrences or mint a replacement source identity. | ||
item_origin | Implemented | ImplementedTODO |
The parser measures each item from the earliest of its first attribute and item-node start, so attribute offsets are nonnegative. Entering an associated item establishes a new item-relative base rather than retaining the enclosing trait or impl base. | ||
offset_reuse | Implemented | ImplementedTODO |
An edit outside an item which only moves its absolute range may update diagnostics and position lookup, but leaves relative CST and typed content equal and must not propagate into semantic consumers which did not read the absolute coordinate. | ||
relative_composition | Implemented | ImplementedTODO |
A source-root item owns an absolute span in one ParseSource. A nested definition is placed relative to its immediate represented owner, and its signature CST, body CST, and typed-body nodes use offsets relative to that definition’s own start. Resolving a nested node composes every intervening relative range with the source-root absolute range. | ||