v2 / vlib / v / tests / options / option_heap_var_test.v
21 lines · 18 sloc · 210 bytes · d23e70f546846c42129f45e8d0febec50e084c2d
Raw
1@[heap]
2struct Foo {
3 a int
4}
5
6struct EdgeService {
7 foo Foo
8}
9
10fn t[S](s S) {
11}
12
13fn test_main() {
14 mut svc := ?EdgeService(EdgeService{})
15 if svc != none {
16 t(svc)
17 assert true
18 } else {
19 assert false
20 }
21}
22