You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module Test;
public type Data = unit {
x: uint8 &convert=($$ + 5) &requires=($$ < 50) {
print $$ < 50;
}
};
I would expect in to print True every time since the &requires succeeded, but instead it may print False:
$ echo '0' | spicy-driver test.spicy
False
I think $$ should continue to refer to the pre-conversion value, personally, but instead it refers to the pre-conversion value in &requires, but after-conversion value in the block.
The text was updated successfully, but these errors were encountered:
Fixes#1914
`$$` says it refers to the pre-conversion value, but that's not true
within a hook. This fixes that so that `$$` always refers to the
pre-conversion value.
Closes#1914
The documentation would refer to `$$` in an attribute and hook with
similar language (the "parsed" value). But, in an attribute, it refers
to the value before any conversions. In a hook, it refers to the value
after any conversions.
Now, "parsed" is used to refer to the pre-conversion value, and "final"
is used to refer to the post-conversion value. Those terms were chosen
because they make sense when no conversions are applied (or when `$$` is
used *in* a conversion). But, "final" can still be a little confusing,
since you can write to `$$`.
Found via bbannier/spicy-lint#54
Given this program:
I would expect in to print
True
every time since the&requires
succeeded, but instead it may printFalse
:I think
$$
should continue to refer to the pre-conversion value, personally, but instead it refers to the pre-conversion value in&requires
, but after-conversion value in the block.The text was updated successfully, but these errors were encountered: