Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
fns
/
fn_heap_promoted_test.v
17
lines
·
13
sloc
·
247 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
@[heap]
2
struct
Context {}
3
4
type
Method =
fn
(ctx Context)
5
6
fn
call(method Method, ctx Context) {
// or switch `ctx` and `method` also ok
7
method(ctx)
8
}
9
10
fn
get(ctx Context) {
11
println(
'ok'
)
12
}
13
14
fn
test_main() {
15
call(get, Context{})
16
assert
true
17
}
18