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.