Skip to content
Playground(another site)

bynk.stub.bad_sequence

Error A stub … returns each […] sequence is malformed (e.g. empty).

returns each […] gives one outcome per call, in order, and the last outcome repeats once the list runs out. An empty list has no outcome to repeat, so the first call would have nothing to return. List at least one. To return an empty list as a single value, write returns [], without each.

Example

demo/meter.bynk
capability Meter { … }
// tests/meter.test.bynk
stub Meter.read() returns each [] // ✗ no outcomes
stub Meter.read() returns each [7] // ✓ at least one

In the Book

See also

  • Every code in its category, Stubs, on the diagnostic index.
  • bynk explain bynk.stub.bad_sequence shows the same from the installed toolchain, without a network.