v2 / vlib / v / tests / fns / fn_heap_promoted_test.v
17 lines · 13 sloc · 247 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1@[heap]
2struct Context {}
3
4type Method = fn (ctx Context)
5
6fn call(method Method, ctx Context) { // or switch `ctx` and `method` also ok
7 method(ctx)
8}
9
10fn get(ctx Context) {
11 println('ok')
12}
13
14fn test_main() {
15 call(get, Context{})
16 assert true
17}
18