ci: fix option_fn_voidptr_test.v after a200c45

This commit is contained in:
Delyan Angelov 2024-12-17 09:06:53 +02:00
parent 70edd21c80
commit d5e50c2f20
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED

View file

@ -1,9 +1,9 @@
struct Foo { struct Foo {
mut: 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 return foo.func? == callback
} }
@ -13,11 +13,11 @@ fn test_main() {
} }
assert t.func? == callback assert t.func? == callback
call_fn := t.func? call_fn := t.func?
assert call_fn(&t) assert call_fn(&t)?
mut a := Foo{} mut a := Foo{}
a.func = callback a.func = callback
assert a.func? == callback assert a.func? == callback
call_fn2 := a.func? call_fn2 := a.func?
assert call_fn2(&a) assert call_fn2(&a)?
} }