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

&requires attribute on vector element ignored #1857

Open
bbannier opened this issue Sep 6, 2024 · 0 comments · May be fixed by #1904
Open

&requires attribute on vector element ignored #1857

bbannier opened this issue Sep 6, 2024 · 0 comments · May be fixed by #1904
Assignees
Labels
Bug Something isn't working Parsing

Comments

@bbannier
Copy link
Member

bbannier commented Sep 6, 2024

We currently do not evaluate &requires attributes on vector elements, e.g., I would expect the following to fail with a &requires error, but instead reach "unreachable".

module foo;

public type X = unit {
    : (uint8 &requires=$$ == 0)[] foreach {
        assert $$ == 0 : "unreachable";
    }
};
$ printf '\x00\x01' | spicy-driver -d foo.spicy
[fatal error] terminating with uncaught exception of type hilti::rt::AssertionFailure: unreachable (foo.spicy:5:9-5:39)

This looks similar to #1860 but was broken before the use case reported there, at least since v1.1.0-dev-22-g0bfdd358c.

@bbannier bbannier added Bug Something isn't working Parsing labels Sep 6, 2024
@bbannier bbannier changed the title &requires attribute on vector element ignore &requires attribute on vector element ignored Sep 6, 2024
@rsmmr rsmmr self-assigned this Oct 21, 2024
rsmmr added a commit that referenced this issue Oct 21, 2024
@rsmmr rsmmr linked a pull request Oct 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Parsing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants