Skip to content

Commit

Permalink
Lift requirement that bytes forwarded from filter be mutable.
Browse files Browse the repository at this point in the history
Since we did not declare the `bytes` argument to `unit::forward`
constant it was implicitly mutable so that it was impossible to e.g.,
pass literal bytes. This patch uses the originally intended type.

Closes #1659.
  • Loading branch information
bbannier committed Feb 7, 2024
1 parent 041a072 commit 38c720b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/autogen/types/unit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
starting position can also be explicitly given, but must lie inside
the same region.

.. spicy:method:: unit::forward unit forward False void (inout data: bytes)
.. spicy:method:: unit::forward unit forward False void (data: bytes)
If the unit is connected as a filter to another one, this method
forwards transformed input over to that other one to parse. If the
Expand Down
2 changes: 1 addition & 1 deletion spicy/toolchain/include/ast/operators/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ BEGIN_METHOD(unit, Forward)
hilti::operator_::Signature{.self = hilti::type::constant(spicy::type::Unit(type::Wildcard())),
.result = hilti::type::void_,
.id = "forward",
.args = {{"data", hilti::type::Bytes()}},
.args = {{"data", hilti::type::constant(hilti::type::Bytes())}},
.doc = R"(
If the unit is connected as a filter to another one, this method forwards
transformed input over to that other one to parse. If the unit is not connected,
Expand Down

0 comments on commit 38c720b

Please sign in to comment.