Skip to content

Commit

Permalink
fix interface smartcast method call
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Sep 30, 2024
1 parent b8677e8 commit d59e6f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vlib/v/gen/c/fn.v
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,9 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
if !node.left.is_lvalue() {
g.write('ADDR(${rec_cc_type}, ')
cast_n++
} else if node.left is ast.Ident && g.table.is_interface_smartcast(node.left.obj) {
g.write('ADDR(${rec_cc_type}, ')
cast_n++
} else if !(left_type.has_flag(.shared_f)
&& g.typ(left_type) == g.typ(node.receiver_type)) {
g.write('&')
Expand Down

0 comments on commit d59e6f9

Please sign in to comment.