Skip to content
Playground(another site)

bynk.test.actor_identity_required

Error A test omits the identity an identity-carrying actor requires: a bare call-site by <Actor>, or no by at all on a handler that binds its Caller.

An actor that declares an identity stands for one particular caller, and the handler reads that identity. A case that acts as the actor must therefore say which caller, as in by User("bob"); a bare by User leaves the handler nothing to read. A handler that binds its caller (by c: Caller) wants the calling context's name the same way. Add the identity. The reverse mistake is bynk.test.actor_no_identity.

Example

demo/api.bynk
type UserId = String where NonEmpty
actor User { … }
// tests/api.test.bynk
let r <- api.GET("/a") by User // ✗ which user?
let r <- api.GET("/a") by User("bob") // ✓

In the Book

See also

  • The grammar rule it governs: case.
  • Every code in its category, Tests, on the diagnostic index.
  • bynk explain bynk.test.actor_identity_required shows the same from the installed toolchain, without a network.