Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$$ is different in block versus in &requires #1914

Open
evantypanski opened this issue Nov 4, 2024 · 0 comments
Open

$$ is different in block versus in &requires #1914

evantypanski opened this issue Nov 4, 2024 · 0 comments

Comments

@evantypanski
Copy link
Contributor

Found via bbannier/spicy-lint#54

Given this program:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant