Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
printing
/
print_anon_fn_test.v
16
lines
·
13
sloc
·
178 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
struct
Foo {
2
mut
:
3
f ?
fn
(int)
4
g
fn
(int)
5
}
6
7
fn
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