Skip to content
Playground(another site)

bynk.resolve.const_outside_context_or_commons

Error A const declaration appears outside a context or commons.

An adapter is the program's boundary with the host: it declares capabilities and the providers a binding supplies, not values for the program to share, so a const is refused there. Declare the constant in a commons, which a unit reads by uses, or in the context that needs it, and move it out of the adapter.

Example

tokens.bynk
const Lifetime: Int = 3600 // ✗ an adapter declares no constants
// limits.bynk
commons limits
const Lifetime: Int = 3600 // ✓ in a commons

In the Book

See also

  • The grammar rule it governs: const_decl.
  • Every code in its category, Resolution, on the diagnostic index.
  • bynk explain bynk.resolve.const_outside_context_or_commons shows the same from the installed toolchain, without a network.