Skip to content
Playground(another site)

bynk.consumes.capability_name_clash

Error Two flattened consumes U { Cap } capabilities collide, or one clashes with a local capability.

consumes payment { Gateway } brings Gateway in by its bare name, so that given Gateway reads it. If the context already declares a capability of that name, or a second consumed unit supplies one, the bare name would mean two things. Reach it qualified instead, given payment.Gateway, rename the local one, or consume the unit under an alias instead of selecting names from it, consumes payment as pay, and write given pay.Gateway.

Example

shop.bynk
context shop
consumes payment { Gateway } // ✗ this context declares a `Gateway` too
capability Gateway {
fn notify() -> Effect[()]
}
consumes payment // ✓ reach it as `payment.Gateway`

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