Skip to content
Playground(another site)

bynk.parse.empty_agent

Error An agent body is empty.

An agent is its storage and the on call handlers that read and change it. One with no handler can never be called, so it is refused, as is one with no store field (bynk.parse.expected_agent_storage). Add a handler.

Example

agent Tally { // ✗ no handler
key id: String
store count: Cell[Int]
}
agent Tally {
key id: String
store count: Cell[Int]
on call get() -> Effect[Result[Int, String]] { // ✓
Ok(count)
}
}

In the Book

See also

  • The grammar rule it governs: agent_decl.
  • Every code in its category, Parser, on the diagnostic index.
  • bynk explain bynk.parse.empty_agent shows the same from the installed toolchain, without a network.