diff --git a/vlib/v/tests/options/option_fn_voidptr_test.v b/vlib/v/tests/options/option_fn_voidptr_test.v index 7508a45c9c..34cb910329 100644 --- a/vlib/v/tests/options/option_fn_voidptr_test.v +++ b/vlib/v/tests/options/option_fn_voidptr_test.v @@ -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 } @@ -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)? }