Skip to content
Playground(another site)

bynk.capability.op_arity

Error A capability operation was called with the wrong number of arguments.

A call to a capability operation passes exactly the parameters its declaration lists, so Clock.now(1) against fn now() -> Effect[Int] has one argument too many. Pass the declared number of arguments. If the operation really needs another parameter, add it to the capability's declaration and to every provider of it.

Example

capability Clock {
fn now() -> Effect[Int]
}
Clock.now(1) // ✗ `now` takes no arguments
Clock.now() // ✓

In the Book

See also