zeek/spicy

Unhelpful error message when "inout" missing in chain

Closed this issue · 1 comments

module Test;

type Fragment = unit(handshakesink: sink) {
	ff: FurtherFragment(handshakesink);
};

type FurtherFragment = unit(inout handshakesink: sink) {
};

generates the following error message:

[error] /Users/johanna/spicy-test/test.spicy:4:2-4:36: type expects strong_ref<spicy_rt::Sink> for parameter 1, but receives strong_ref<spicy_rt::Sink>
[error] <Spicy support for Zeek>: aborting after errors

As both the expected type and the received type in the error message are the same, this seems a bit misleading :)

With #1712, we now reject this. The recommended way of doing this is:

module Test;

type Fragment = unit(handshakesink: sink&) {
	ff: FurtherFragment(handshakesink);
};

type FurtherFragment = unit(handshakesink: sink&) {
};