Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Nov 19, 2024
1 parent df252db commit 4d564aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/v/checker/containers.v
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ fn (mut c Checker) array_init(mut node ast.ArrayInit) ast.Type {
typ = c.cast_fixed_array_ret(typ, ret_sym)
}
node.has_tmp_var = true
} else if expr is ast.CastExpr {
node.has_tmp_var = true
} else if !node.has_tmp_var && mut expr is ast.CastExpr {
node.has_tmp_var = expr.expr is ast.ArrayInit && expr.expr.has_tmp_var
}
if typ == ast.void_type {
c.error('invalid void array element type', expr.pos())
Expand Down

0 comments on commit 4d564aa

Please sign in to comment.