bynk.property.restates_refinement
Error A property merely re-checks a refinement its type already guarantees.
A for all q: Quantity property draws only valid values of Quantity, so a body that just asserts the type's refinement, expect q > 0 over Int where Positive, cannot fail and proves nothing about your code. The compiler flags it. The check is narrow: it fires only when the body is that one expect, restating Positive or NonNegative over the bound value, so a near-copy may pass. Assert something about what your code does with the value, or delete the property.
Example
type Quantity = Int where Positive
// tests/demo.test.bynkfor all q: Quantity { expect q > 0 } // ✗ the type already says thisfor all q: Quantity { expect double(q) > q } // ✓ a claim about `double`In the Book
- Testing › @example — a value for a pattern
- Testing
- Write tests, stub collaborators, and pin a `Val[T]`
See also
- The grammar rule it governs:
for_all. - Every code in its category, Properties (generative tests), on the diagnostic index.
bynk explain bynk.property.restates_refinementshows the same from the installed toolchain, without a network.