[FP] Avoid linting for $$
with &convert
#54
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.
Attributes on a field with
&convert
make$$
mean something different.$$
refers to before the conversion,self.field
refers to after.Obligatory note: There's more nuance, but I almost see it as a spicy bug. If you run the example and print both
self.x
and$$
, you'll see they'll be the same. But if you try swapping them out in a&requires
, they'll be different. That seems wrong to me, so I didn't add that logic in. Maybe worth an issueBTW this is where it was triggering in spicy Redis, where the replacement makes Spicy not compile the code because that's before a type conversion:
https://github.com/evantypanski/spicy-redis/blob/8101fd33f1c3b3e627e6032741c3c42126790670/analyzer/resp.spicy#L108