mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
34b28cb68a
commit
64e8125807
@ -4352,6 +4352,10 @@ fn (mut g Gen) go_stmt(node ast.GoStmt) {
|
||||
if expr.is_method {
|
||||
receiver_sym := g.table.get_type_symbol(expr.receiver_type)
|
||||
name = receiver_sym.name + '_' + name
|
||||
} else if expr.left is ast.AnonFn as anon_fn {
|
||||
g.gen_anon_fn_decl(anon_fn)
|
||||
fsym := g.table.get_type_symbol(anon_fn.typ)
|
||||
name = fsym.name
|
||||
}
|
||||
name = util.no_dots(name)
|
||||
g.writeln('// go')
|
||||
|
9
vlib/v/tests/anon_fn_test.v
Normal file
9
vlib/v/tests/anon_fn_test.v
Normal file
@ -0,0 +1,9 @@
|
||||
import sync
|
||||
|
||||
fn test_go_anon_fn() {
|
||||
mut wg := sync.new_waitgroup()
|
||||
go fn (mut wg sync.WaitGroup) {
|
||||
wg.done()
|
||||
}(mut wg)
|
||||
wg.wait()
|
||||
}
|
Loading…
Reference in New Issue
Block a user