You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# file: foo.spicy
module foo;
function fun(s: sink): bool {
s.close();
return True;
}
type Y = unit {
sink s;
x: X(self.s);
};
type X = unit (s: sink){
data: uint8;
var a: bool;
on data {
self.a = fun(s);
}
};
Causes the following error:
$ spicyc -j ./foo.spicy
/private/var/folders/xg/y2l9jptj6bq6gm7rz1mm2lc80000gn/T/foo_93d27a28ebfe11ba-92d90ada2067c1b3.cc:354:5: error: 'this' argument to member function 'close' has type 'const spicy::rt::Sink', but function is not marked const
(*s).close();
^~~~
/Users/johanna/zeek/install/include/spicy/rt/sink.h:170:10: note: 'close' declared here
void close() { _close(true); }
^
1 error generated.
[error] spicyc: JIT compilation failed
It can be resolved by either calling s.close() in on data, or by changing the function signature to use inout for the sink. However, this still seems like a bug/inconsistency since one does not need inout when passing sinks to other units.
The text was updated successfully, but these errors were encountered:
The issue here is that we generate a C++ function which passes the sink parameter as a const, i.e., a pure in parameter. One way to work around this until a fix is available would be to declare the parameter as inout,
Causes the following error:
It can be resolved by either calling
s.close()
inon data
, or by changing the function signature to useinout
for the sink. However, this still seems like a bug/inconsistency since one does not needinout
when passing sinks to other units.The text was updated successfully, but these errors were encountered: