bynk.transition.impure_predicate
Error A transition predicate uses an effectful or test-only construct; a step invariant must be pure.
A transition is checked at each commit, over the old and new states, so it may only read: old, new, operators and pure value methods. Effect.pure, ?, expect, Val and the other test-only forms are refused, as is anything that performs an effect. Rewrite the predicate as a plain Bool expression. The mirror rule for states is bynk.invariant.impure_predicate.
Example
transition grows: Effect.pure(new.count >= old.count) // ✗ an effect, not a pure predicate
transition grows: new.count >= old.count // ✓ a plain `Bool` expressionIn the Book
See also
- Every code in its category, Transitions (step invariants), on the diagnostic index.
bynk explain bynk.transition.impure_predicateshows the same from the installed toolchain, without a network.