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
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
- Share a capability across contexts › Consume it with a qualified given
- Adapters
- Wrap a library as an adapter
- Share code between projects › Approve a dependency’s npm packages
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_clashshows the same from the installed toolchain, without a network.