1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: minor cleanup in ref_or_deref_arg() (#13874)

This commit is contained in:
yuyi 2022-03-31 02:06:38 +08:00 committed by GitHub
parent d40a502981
commit ae1cb5697e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1748,8 +1748,8 @@ fn (mut g Gen) ref_or_deref_arg(arg ast.CallArg, expected_type ast.Type, lang as
expected_type expected_type
} }
deref_sym := g.table.sym(expected_deref_type) deref_sym := g.table.sym(expected_deref_type)
if !((arg_typ_sym.kind == .function) if arg_typ_sym.kind != .function && deref_sym.kind !in [.sum_type, .interface_]
|| deref_sym.kind in [.sum_type, .interface_]) && lang != .c { && lang != .c {
if arg.expr.is_lvalue() { if arg.expr.is_lvalue() {
g.write('(voidptr)&/*qq*/') g.write('(voidptr)&/*qq*/')
} else { } else {