spicy
spicy copied to clipboard
inout does not work with basic types
According to the documentation at https://docs.zeek.org/projects/spicy/en/latest/programming/parsing.html?highlight=inout#unit-parameters, a string parameter should be able to be declared as inout.
Trying this:
module TESTING;
public type Handshake = unit(inout version: string) {
handshakes: bytes &size=0;
};
Yields the following error message:
[error] test3.spicy:3:1-5:3: only parameters of reference type can be 'inout' for struct parameters
Expected behavior: no error and parameter is modifiable in the unit.
This actually works today, but one needs to write additional code to pass basic types as unit parameters. I created #755 to document this.
I think this is fixed - the example works now.
Thanks for checking in on this @0xxon. This was fixed by #1170 which will be part of v1.6.0.