Skip to content
Playground(another site)

bynk.consumes.target_is_commons

Error consumes targets a commons instead of a context.

consumes is for depending on a context, or on an adapter: it is how you call a service and use the capabilities the other unit exports. A commons has neither. It is shared types and functions, brought in with uses. Replace consumes with uses.

Example

money.bynk
commons money
type Amount = Int where NonNegative
// shop.bynk
context shop
consumes money // ✗ `money` is a commons
uses money // ✓ shared declarations come in with `uses`

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