Detect and report vacuous properties #627
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is important for minimizing user confusion and surprise. Because
property
assumes transaction success, when a function cannotsuccessfully run to completion, it is possible to "validate" any
property
in this setting.Consider some logical formula that corresponds to the Pact expression
(property some_property)
, wheresome_property
can be anything:This is equivalent to:
If
tx_success
is always false, then this expression is always true, nomatter the value of
some_property
.We now detect such a condition where it is not possible for this
function to succeed (if called as a top-level function), and we produce
an error notifying the user that the property is moot:
Closes #623.
/cc @ggobugi27