bynk.consumes.service_arity
Error A consumed service was called with the wrong number of arguments.
A cross-context call has the shape of the on call handler it reaches: one argument for each parameter. The consumed context owns that signature, so the caller adapts to it. Pass the arguments the handler declares (the note says where it is declared), or change the handler's parameters if the service needs different input.
Example
context pay
service charge { on call(amount: Int) -> Effect[Int] by Caller { Effect.pure(amount) }}
// shop.bynkcontext shop
consumes pay
service checkout { on call() -> Effect[Int] by Caller { pay.charge(1, 2) // ✗ `charge` takes one argument }}
service checkout { on call() -> Effect[Int] by Caller { pay.charge(1) // ✓ one argument for `amount` }}In the Book
See also
- The grammar rule it governs:
consumes_decl. - Every code in its category, Consumes, on the diagnostic index.
bynk explain bynk.consumes.service_arityshows the same from the installed toolchain, without a network.