mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: make go func with array type work (#15747)
This commit is contained in:
parent
f51384c402
commit
a3d6a9349d
@ -1718,7 +1718,7 @@ fn (mut g Gen) go_expr(node ast.GoExpr) {
|
|||||||
}
|
}
|
||||||
if expr.is_method {
|
if expr.is_method {
|
||||||
receiver_sym := g.table.sym(expr.receiver_type)
|
receiver_sym := g.table.sym(expr.receiver_type)
|
||||||
name = receiver_sym.name + '_' + name
|
name = receiver_sym.cname + '_' + name
|
||||||
} else if mut expr.left is ast.AnonFn {
|
} else if mut expr.left is ast.AnonFn {
|
||||||
if expr.left.inherited_vars.len > 0 {
|
if expr.left.inherited_vars.len > 0 {
|
||||||
fn_var := g.fn_var_signature(expr.left.decl.return_type, expr.left.decl.params.map(it.typ),
|
fn_var := g.fn_var_signature(expr.left.decl.return_type, expr.left.decl.params.map(it.typ),
|
||||||
|
9
vlib/v/tests/go_call_fn_return_test.v
Normal file
9
vlib/v/tests/go_call_fn_return_test.v
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
const text = 'Hello world'
|
||||||
|
|
||||||
|
fn test_go_call_fn_return() {
|
||||||
|
hex_go := go text.bytes().hex()
|
||||||
|
hex := text.bytes().hex()
|
||||||
|
|
||||||
|
assert hex == '48656c6c6f20776f726c64'
|
||||||
|
assert hex_go.wait() == hex
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user