Skip to content
Playground(another site)

bynk.parse.consumes_after_decls

Error consumes appears after other declarations.

In the fragment form of a context (the header with no braces), the consumes clauses come straight after the uses lines, before any type or fn, so a unit's dependencies are all stated at the top. Move the consumes line up. uses and exports follow the same rule, as bynk.parse.uses_after_decls and bynk.parse.exports_after_decls.

Example

context shop.orders
type Id = String
consumes shop.payment // ✗ a declaration comes first
context shop.orders
consumes shop.payment // ✓ clauses straight after the header
type Id = String

In the Book

See also

  • The grammar rule it governs: consumes_decl.
  • Every code in its category, Parser, on the diagnostic index.
  • bynk explain bynk.parse.consumes_after_decls shows the same from the installed toolchain, without a network.