Skip to content
Playground(another site)

bynk.parse.exports_after_decls

Error exports appears after other declarations.

In the fragment form of a context (the header with no braces), the exports clauses come after the uses and consumes lines and before any type or fn, so what a unit offers is stated at the top. Move the exports line up. uses and consumes follow the same rule, as bynk.parse.uses_after_decls and bynk.parse.consumes_after_decls.

Example

context shop.orders
type Id = String
exports transparent { Id } // ✗ a declaration comes first
context shop.orders
exports transparent { Id } // ✓ clauses straight after the header
type Id = String

In the Book

See also

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