Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/topic/bbannier/issue-1447'
Browse files Browse the repository at this point in the history
  • Loading branch information
bbannier committed Jun 9, 2023
2 parents 29193d7 + 51647aa commit 6f43758
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
1.8.0-dev.173 | 2023-06-09 10:01:28 +0200

* GH-1447: Do not forcibly make `strong_ref` `in` function parameters immutable. (Benjamin Bannier, Corelight)

We previously would always emit a `const` value when passing a
`strong_ref` as a function parameter. This lead to the unintuitive error
that non-const `strong_ref` parameters could not be modified or have
non-const methods called on them (this would actually fail at codegen
time).

With this patch we remove the special treatment of `strong_ref`
parameter mutability.

Closes #1447.

1.8.0-dev.171 | 2023-06-09 10:00:51 +0200

* GH-1452: Allow resolving of unit parameters before `self` is fully resolved. (Benjamin Bannier, Corelight)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.0-dev.171
1.8.0-dev.173
2 changes: 1 addition & 1 deletion hilti/toolchain/src/compiler/codegen/types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ struct VisitorStorage : hilti::visitor::PreOrder<CxxTypes, VisitorStorage> {
else
t = "*";

return CxxTypes{.base_type = t, .param_in = fmt("const %s", t), .param_inout = fmt("%s", t)};
return CxxTypes{.base_type = t, .param_in = fmt("%s", t), .param_inout = fmt("%s", t)};
}

result_t operator()(const type::stream::View& n) { return CxxTypes{.base_type = "::hilti::rt::stream::View"}; }
Expand Down

0 comments on commit 6f43758

Please sign in to comment.