Skip to content
Playground(another site)

bynk.parse.transition_after_handler

Error A transition is declared after an agent handler; step invariants precede the handlers.

A transition checks each committed step of an agent against the one before it, so it belongs with the agent's invariants, above the handlers whose steps it constrains. One written after a handler is refused. Move it above the first handler. bynk.parse.invariant_after_handler and bynk.parse.migrate_after_handler are the same rule for invariants and migrations.

Example

agent Counter {
key id: String
store n: Cell[Int]
on call get() -> Effect[Int] { … }
transition up: // ✗ after a handler
new.n >= old.n
}
agent Counter {
key id: String
store n: Cell[Int]
transition up: // ✓ before the handlers
new.n >= old.n
on call get() -> Effect[Int] { … }
}

In the Book

See also

  • Every code in its category, Parser, on the diagnostic index.
  • bynk explain bynk.parse.transition_after_handler shows the same from the installed toolchain, without a network.