fix(compiler): fix validation for undefined variables nested in values #883
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.
Previously, an operation like this would pass validation:
It turns out this is not very common as we haven't seen this cause a problem
on hundreds of thousands of operations. But it does happen :)
This moves the UndefinedVariable rule to value validation: we are already
recursing into the value here, and we're actually also already checking
that the variable exists, so this is a simpler place to do it than in
the
variable.rs
module.This fixes the immediate problem. There are two things that I may be able to
address here before we merge it time willing...
variable.rs
, but the type of a variable used inside a nested value insidevalue.rs
, and both ways are different? Is this correct according to spec or should it be changed?