Pular para o conteúdo
TE808 · Efeitos · error

Tipo de argumento incompatível no `perform`

Uma chamada `perform Efeito::op(…)` passou um argumento cujo tipo não corresponde ao tipo do parâmetro declarado da operação.

Why this fires

A perform Effect::op(...) call passed an argument whose type doesn't match the operation's declared parameter type.

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

fn run() with Fs {
    let _ = perform Fs::read(42)
    //                       ^^ error[TE808]: perform Fs::read: argument 1 has
    //                          type `int`, expected `str`
}

Fix it

Pass an argument of the declared type:

fn run() with Fs {
    let _ = perform Fs::read("hello")   // ok
}

See also

  • TE805 — a handler arm's parameter count doesn't match the operation's arity (the handling side of the same mismatch).
  • /docs/algebraic-effects — effect operation signatures.

Veja também

Buscar no Zolo

9 resultados

en