Saltar al contenido
TE807 · Efectos · error

La cobertura del handler-valor está incompleta

`handle … with <handler_valor>` usa un handler-valor que cubre solo parte de las operaciones del efecto. El error aparece en el `with` y nombra las operaciones faltantes.

Why this fires

handle <expr> with <handler_value> uses a value (a let h = handler { ... } binding, or an inline handler { ... } literal) instead of inline arms. When that handler value only covers some of an effect's operations — some arms present, but not all — TE807 fires at the with site, naming the missing operation(s).

effect Graphics {
    fn setup()
    fn draw()
}

pub let gfx = handler {
    Graphics::setup() => { 1 },
}

fn render() with Graphics {
    perform Graphics::setup()
    perform Graphics::draw()
}

fn boot() {
    handle render() with gfx
    // error[TE807]: handler does not cover all operations of effect 'Graphics';
    //               missing: draw
}

Fix it

Add an arm for the missing operation to the handler value:

pub let gfx = handler {
    Graphics::setup() => { 1 },
    Graphics::draw()  => { 2 },   // ok — now fully covered
}

See also

  • TE803 — the same coverage check for inline handle ... with { ... } arms.
  • TE814handle ... with h where h isn't a handler at all.
  • /docs/algebraic-effects — handler values (let h = handler { ... }).

Véase también

Buscar en Zolo

9 resultados

en