spicy icon indicating copy to clipboard operation
spicy copied to clipboard

`&requires` attribute on vector element ignored

Open bbannier opened this issue 1 year ago • 0 comments

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 avatar Sep 06 '24 07:09 bbannier