Skip to content
ZOLO / TE804 Effects · error

effect has no such operation

The handler references an operation name that does not exist on the effect.

Why this fires

A handle ... with { ... } arm names an operation that doesn't exist on the effect — usually a typo.

effect Fs { fn read(p: str) -> str }

fn run() with Fs {}

fn driver() {
    handle run() with {
        Fs::ghost(_) => "x",
        //  ^^^^^ error[TE804]: effect 'Fs' has no operation 'ghost'
        Fs::read(_) => "y",
    }
}

Fix it

Fix the operation name to match one the effect actually declares:

fn driver() {
    handle run() with {
        Fs::read(_) => "y",     // ok
    }
}

See also

  • TE803 — a handle block doesn't cover every operation of an effect.
  • TE805 — a handler arm's parameter count doesn't match the operation's arity.
  • /docs/algebraic-effects — handle blocks and effect operations.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br