Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Apr 25, 2024
1 parent 87e877f commit 28a7e51
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions vlib/v/tests/fn_mut_params_test.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@[params]
struct Params {
mut:
a bool
x int
}

fn foo(mut opts Params) bool {
opts.x++
if opts.x < 2 {
foo(opts)
opts.a = true
}
return opts.a
}

fn test_call() {
assert foo()
}

0 comments on commit 28a7e51

Please sign in to comment.