Skip to content
Playground(another site)

bynk.consumes.signature_type_unconsumed

Error A cross-context call reaches a service whose signature names a type the consumed context itself consumes from a third context, which the caller does not consume.

A service you call may take or return a type declared in a third context. The value crosses the call as that context's type, so your context has to state the dependency itself: it does not inherit it from the service's context. Add consumes for the context the error names.

Example

shop/ledger.bynk
consumes shop.order
service domestic {
on call(id: String) -> Effect[Order] by Caller { … }
}
// shop/front.bynk
consumes shop.ledger
let o <- shop.ledger.domestic(id) // ✗ returns `Order`, from `shop.order`
consumes shop.ledger
consumes shop.order // ✓ the dependency is stated

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.signature_type_unconsumed shows the same from the installed toolchain, without a network.