Skip to content

Commit

Permalink
ci: fix option_fn_voidptr_test.v after a200c45
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Dec 17, 2024
1 parent 70edd21 commit d5e50c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vlib/v/tests/options/option_fn_voidptr_test.v
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
struct Foo {
mut:
func ?fn (voidptr) bool = unsafe { nil }
func ?fn (voidptr) ?bool = unsafe { nil }
}

fn callback(foo &Foo) bool {
fn callback(foo &Foo) ?bool {
return foo.func? == callback
}

Expand All @@ -13,11 +13,11 @@ fn test_main() {
}
assert t.func? == callback
call_fn := t.func?
assert call_fn(&t)
assert call_fn(&t)?

mut a := Foo{}
a.func = callback
assert a.func? == callback
call_fn2 := a.func?
assert call_fn2(&a)
assert call_fn2(&a)?
}

0 comments on commit d5e50c2

Please sign in to comment.