Fix over-eager caching of Now variable #191
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.
Closes #185.
I gave a shot at making tests for this, but it's less trivial than it seems at first glance. I manually confirmed this fixes the bug for now.
To explain what's going on here, you have to recognize that
newRulesVariable
is used during constraint compilation (for constant folding) andnewThisVariable
is used during the actual activation. We don't wantnow
to get constant-folded, so we should make sure it is only defined at evaluation time, not before. I think this was most likely switched on accident and probably also means that thenow
variable was not working in custom constraints.