bynk.stub.rhs_type
Error A test stub … returns <value> right-hand side does not match the operation's return type.
A stub … returns <value> stands in for a real provider, so the value must have the type the operation declares, as the real result would. Meter.read yields an Int, so it returns 7, not a string; the Effect is supplied for you. Change the value, or stub the operation you meant. To inject a failure, write fails instead of a value.
Example
capability Meter { … }
// tests/meter.test.bynkstub Meter.read() returns "seven" // ✗ a String, not an Intstub Meter.read() returns 7 // ✓In the Book
See also
- Every code in its category, Stubs, on the diagnostic index.
bynk explain bynk.stub.rhs_typeshows the same from the installed toolchain, without a network.