fn sir_param_correction(prog: &mut SirProgram) -> WeldResult<()> {
    let mut env = HashMap::new();
    let mut closure = HashSet::new();
    let mut visited = HashSet::new();
    sir_param_correction_helper(prog, 0, &mut env, &mut closure, &mut visited);
    let func = &prog.funcs[0];
    for name in closure {
        if func.params.get(&name) == None {
            compile_err!("Unbound symbol {}", name.to_string())?;
        }
    }
    Ok(())
}
gen_expr may result in the use of symbols across function boundaries,
so ast_to_sir calls sir_param_correction to correct function parameters
to ensure that such symbols (the closure) are passed in as parameters.
Can be safely called multiple times -- only the necessary param corrections
will be performed.
weld/src/sir/mod.rs