spicy icon indicating copy to clipboard operation
spicy copied to clipboard

`bytes::match` returns undocumented type `result<bytes>`

Open bbannier opened this issue 1 year ago • 0 comments

Currently the Spicy operator bytes::match returns result<bytes> where result is a HILTI type we do not expose or documented anywhere in Spicy, https://github.com/zeek/spicy/blob/b1f54e4d42fb950230f70633ad74d1aac9216e18/hilti/toolchain/src/ast/operators/bytes.cc#L987-L988

I would naively have expected that this should be able to return just bytes, but it seems that we rely on being able to convert the result to a boolean so simply changing the signature breaks things,

 .result = {Constness::Const, builder->typeBytes()},

bbannier avatar May 02 '24 19:05 bbannier