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

cgen: minor cleanup in method_call() (#15894)

This commit is contained in:
yuyi 2022-09-28 01:05:04 +08:00 committed by GitHub
parent 57e4ba4cd0
commit bdf4c679da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -715,7 +715,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
}
left_type := g.unwrap_generic(node.left_type)
mut unwrapped_rec_type := node.receiver_type
if unsafe { g.cur_fn != 0 } && g.cur_fn.generic_names.len > 0 { // in generic fn
if g.cur_fn != unsafe { nil } && g.cur_fn.generic_names.len > 0 { // in generic fn
unwrapped_rec_type = g.unwrap_generic(node.receiver_type)
} else { // in non-generic fn
sym := g.table.sym(node.receiver_type)