Skip to content
Playground(another site)

bynk.consumes.type_alias_capability

Error A capability was aliased in consumes U { Cap as Alias }; only exported types can be aliased.

as renames a type that the consumed context exports, for use in this one. A capability keeps its own name wherever it is used, in given and in calls. Select it bare, consumes payment { Gateway }, or consume the context without braces and write given payment.Gateway.

Example

payment.bynk
context payment
exports capability { Gateway }
// shop.bynk
context shop
consumes payment { Gateway as Pay } // ✗ a capability cannot be aliased
consumes payment { Gateway } // ✓ select it bare

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