bynk.expect.faults_not_effect
Error A fault claim's subject (expect <call> faults) is not an effectful call: a value, or a call whose type is not Effect[_].
expect <call> faults claims that an effectful call throws, for instance because a stub … fails. Only a call can fault, so the subject must be the call itself, with type Effect[_]. A value already bound, or a pure method on one, has nothing left to throw. Write the call inside the claim, not a name bound from it. A fault that is not claimed fails the case.
Example
let label = "sealed"expect label.length() faults // ✗ a pure method, not an effectful callexpect box.call() faults // ✓ the call that faultsIn the Book
See also
- The grammar rule it governs:
faults_expr. - Every code in its category, Expectations, on the diagnostic index.
bynk explain bynk.expect.faults_not_effectshows the same from the installed toolchain, without a network.