bynk.consumes.name_conflict
Error A consumes name collides with another name in scope.
consumes payment brings every type that payment exports into scope under its own name, because the services' signatures use them. If this context already has something of that name, a type declared here or reached through uses, or a function, asset, service, agent or provider, a mention would mean two things, so the compiler refuses the clause. Rename the imported type with as: it is then in scope only under the alias, and is still the same type. bynk.consumes.type_alias_conflict is the same clash with an alias.
Example
context payment
exports transparent { Amount }
// money.bynkcommons money
type Amount = Int where NonNegative
// orders.bynkcontext orders
uses moneyconsumes payment // ✗ `Amount` is also in scope from `money`consumes payment { Amount as PayAmount } // ✓ `PayAmount` is `payment`'sIn 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.name_conflictshows the same from the installed toolchain, without a network.