Skip to main content

verify_binders

Function verify_binders 

Source
pub fn verify_binders(
    binders: &[Binder],
    wire_type: impl Fn(&str) -> Option<PortType>,
) -> Vec<BinderViolation>
Expand description

Every slot whose wire type cannot satisfy its lvalue type, given a lookup from wire name to the program’s type for it.

Verify each binder slot’s rvalue (wire) type against its declared lvalue type, using the lookup closure to resolve wire names to their PortType. The closure returns None for unknown wires.

Returns every violation found (not just the first) so the operator fixes them in one pass.

Why a closure instead of &PolydatProgram: the verifier shouldn’t be coupled to one program/kernel surface. Callers supply whatever lookup matches their wire-resolution context — kernel program output table, scope-init constants, auto-externed parent-scope wires, or test fixtures.