bynk.adapter.disallowed_item
Error An adapter declared a service, agent, or other item it may not contain.
An adapter wraps foreign code, so it holds only what describes that boundary: capabilities, the types that cross it, external providers and helper functions. A service, an agent or an actor has behaviour, state and an address of its own, and those belong to a context. Move the item into a context that consumes the adapter's capability, and leave the adapter as an interface to the foreign code.
Example
adapter tokens { binding "./tokens.binding.ts" provides Jwt = JoseJwt service login { // ✗ an adapter may not declare a service on call(x: Int) -> Effect[Int] by Caller { … } }}
adapter tokens { binding "./tokens.binding.ts" provides Jwt = JoseJwt // ✓ capabilities and providers only}In the Book
- Adapters › Anatomy
- Adapters
- Wrap a library as an adapter
- Share code between projects › Approve a dependency’s npm packages
See also
- The grammar rule it governs:
adapter_decl. - Every code in its category, Adapters, on the diagnostic index.
bynk explain bynk.adapter.disallowed_itemshows the same from the installed toolchain, without a network.