pub struct FnResolution {
pub local_count: u16,
pub local_slots: Arc<HashMap<String, u16>>,
pub local_slot_types: Arc<Vec<Type>>,
}Expand description
Compile-time resolution metadata for a function body.
Produced by resolver::resolve_fn — maps local variable names to slot indices
so the VM can use Vec<Value> instead of HashMap lookups.
Fields§
§local_count: u16Total number of local slots needed (params + bindings in body).
local_slots: Arc<HashMap<String, u16>>Map from local variable name → slot index in the local Slots frame.
local_slot_types: Arc<Vec<Type>>Aver type per slot index. Length == local_count. Built post-
typecheck so each entry pulls from the matching Spanned::ty()
stamp on the producer expression, plus pattern-binding shape
rules (Result.Ok → T, Cons head → list element, tuple item
→ tuple element, …). Backends that need a typed local table
(the wasm-gc lowering uses one to declare each local with a
concrete ValType) consume this directly instead of re-deriving
the same information from patterns.
Default Type::Invalid for unreachable / unstamped slots — every
real binding gets overwritten during the slot-types pass, so an
Invalid reaching the backend means the slot was never the
target of a binding (resolver counted but no expression
produced into it; usually a wildcard slot the backend skips).
Trait Implementations§
Source§impl Clone for FnResolution
impl Clone for FnResolution
Source§fn clone(&self) -> FnResolution
fn clone(&self) -> FnResolution
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more