Skip to content
Playground(another site)

bynk.consumes.self_reference

Error A context consumes itself.

consumes declares that a context depends on a different one. A context's own declarations are already in scope, so consuming itself adds nothing, and a context that depends on itself is a cycle of length one. Delete the clause, or, if you meant another context, name it. A cycle through several contexts is bynk.context.consumes_cycle.

Example

pay.bynk
context pay
// shop.bynk
context shop
consumes shop // ✗ a context cannot consume itself
consumes pay // ✓ a different context

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