pub fn validate_binding_type(
value: &VmValue,
slot: &BindingTypeSlot,
span: Option<Span>,
) -> Result<(), VmError>Expand description
Validate an annotated let / const initializer against its declared type.
The binding-site counterpart of validate_user_call’s per-parameter
assertion, and deliberately the same decision procedure: both project the
value through harn_kernel::type_contract::matches_type. A declared type
therefore accepts and rejects the same values whether it is written on a
parameter or on a binding — which is the whole point of checking bindings
at all (harn#6252).