Skip to content
Playground(another site)

bynk.uses.target_is_context

Error uses targets a context instead of a commons.

uses is for shared types and functions, and those live in a commons. A context is something to depend on: it has services to call and capabilities to use, and that is consumes. Replace uses with consumes. The mirror of this is bynk.consumes.target_is_commons.

Example

pay.bynk
context pay
// shop.bynk
context shop
uses pay // ✗ `pay` is a context
consumes pay // ✓ depend on a context with `consumes`

In the Book

See also

  • The grammar rule it governs: uses_decl.
  • Every code in its category, Uses, on the diagnostic index.
  • bynk explain bynk.uses.target_is_context shows the same from the installed toolchain, without a network.