Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmt: add fn_with_mut_ref_params_keep.vv (related #21706) #21711

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions vlib/v/fmt/tests/fn_with_mut_ref_params_keep.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
struct Bar {}

fn in_both_mut_ref(mut arr []&Bar, mut bar &Bar) {
assert bar !in arr
}

fn main() {
mut arr := []&Bar{}
mut bar := Bar{}
in_both_mut_ref(mut &arr, mut &bar)
}
2 changes: 0 additions & 2 deletions vlib/v/tests/in_expression_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ fn test_in_array_of_sumtype() {
// for issue 20268
struct Bar {}

// vfmt off
fn in_both_mut_ref(mut arr []&Bar, mut bar &Bar) {
assert bar !in arr
}
Expand All @@ -341,4 +340,3 @@ fn test_in_both_mut_and_ref() {
mut bar := Bar{}
in_both_mut_ref(mut &arr, mut &bar)
}
// vfmt on
Loading