Skip to main content

check_program_with_resolver

Function check_program_with_resolver 

Source
pub fn check_program_with_resolver<R>(
    stmts: &[Stmt],
    resolver: &mut R,
) -> Vec<BopWarning>
where R: FnMut(&str) -> Option<Result<String, BopError>>,
Expand description

Like check_program but follows use statements via a module resolver so match arms over imported enums can be exhaustiveness-checked. resolver has the same shape as BopHost::resolve_module:

  • Some(Ok(source)) — module source; parsed + its enums (transitively) folded into the table.
  • Some(Err(_)) — resolver failed; treated the same as None (check skips the enum; advisory fallback).
  • None — not our module; skip.

The checker never surfaces a failure from the resolver — it simply falls back to “imported enums stay opaque” in that case, the same behaviour check_program has.