bynk.resolve.unconsumed_context
Error A context's service was called, or its capability named in given, without a consumes declaration.
A call such as platform.pay.charge(1) reaches into another context, and a context may only do that to one it has declared with consumes. The declaration is what makes a dependency between contexts visible and checked, instead of a name that happens to resolve. The same code is reported for a given platform.pay.Cap whose context is not consumed. Add consumes platform.pay (with an alias, if you want to call it by another name) at the top of the calling context. A consumed context that does not export a capability is bynk.given.cross_context_unknown_capability.
Example
context app.shop
service checkout { on call() -> Effect[Int] by Caller { platform.pay.charge(1) // ✗ `platform.pay` is not in this context's `consumes` }}
context app.shop
consumes platform.pay // ✓ declared at the topIn the Book
- Consume another context's services with `consumes` › Declare the dependency and call the service
- Share a capability across contexts
- Capabilities & providers
See also
- The grammar rule it governs:
consumes_decl. - Every code in its category, Resolution, on the diagnostic index.
bynk explain bynk.resolve.unconsumed_contextshows the same from the installed toolchain, without a network.