mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: modify the temporary variable name of the previous pr 15744 (#15745)
This commit is contained in:
parent
7cff7fb828
commit
f51384c402
@ -1344,14 +1344,14 @@ fn (mut g Gen) fn_call(node ast.CallExpr) {
|
||||
ast.Var {
|
||||
// Temp fix generate call fn error when the struct type of sumtype
|
||||
// has the fn field and is same to the struct name.
|
||||
mut is_need_cast := true
|
||||
mut is_cast_needed := true
|
||||
if node.left_type != 0 {
|
||||
left_sym := g.table.sym(node.left_type)
|
||||
if left_sym.kind == .struct_ && node.name == obj.name {
|
||||
is_need_cast = false
|
||||
is_cast_needed = false
|
||||
}
|
||||
}
|
||||
if obj.smartcasts.len > 0 && is_need_cast {
|
||||
if obj.smartcasts.len > 0 && is_cast_needed {
|
||||
for _ in obj.smartcasts {
|
||||
g.write('(*')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user