v2 / vlib / v / tests / printing / print_anon_fn_test.v
16 lines · 13 sloc · 178 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1struct Foo {
2mut:
3 f ?fn (int)
4 g fn (int)
5}
6
7fn test_main() {
8 mut foo := ?Foo{}
9 assert foo == none
10
11 foo = Foo{}
12 assert foo != none
13
14 println(foo?.f)
15 println('${foo?.f}')
16}
17