mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vfmt: fix formatting for x, _ := f()
This commit is contained in:
parent
e23925f2be
commit
5ad957f270
@ -2868,15 +2868,12 @@ pub fn (mut c Checker) postfix_expr(mut node ast.PostfixExpr) table.Type {
|
|||||||
println(typ_sym.kind.str())
|
println(typ_sym.kind.str())
|
||||||
c.error('invalid operation: $node.op.str() (non-numeric type `$typ_sym.name`)',
|
c.error('invalid operation: $node.op.str() (non-numeric type `$typ_sym.name`)',
|
||||||
node.pos)
|
node.pos)
|
||||||
}
|
} else {
|
||||||
//
|
|
||||||
else {
|
|
||||||
node.auto_locked, _ = c.fail_if_immutable(node.expr)
|
node.auto_locked, _ = c.fail_if_immutable(node.expr)
|
||||||
}
|
}
|
||||||
if (typ.is_ptr() || typ_sym.is_pointer()) && !c.inside_unsafe {
|
if (typ.is_ptr() || typ_sym.is_pointer()) && !c.inside_unsafe {
|
||||||
c.error('pointer arithmetic is only allowed in `unsafe` blocks', node.pos)
|
c.error('pointer arithmetic is only allowed in `unsafe` blocks', node.pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
return typ
|
return typ
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,12 +258,12 @@ pub fn (mut f Fmt) stmt(node ast.Stmt) {
|
|||||||
f.write(var_info.share.str() + ' ')
|
f.write(var_info.share.str() + ' ')
|
||||||
}
|
}
|
||||||
f.expr(left)
|
f.expr(left)
|
||||||
if i < node.left.len - 1 {
|
|
||||||
f.write(', ')
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
f.expr(left)
|
f.expr(left)
|
||||||
}
|
}
|
||||||
|
if i < node.left.len - 1 {
|
||||||
|
f.write(', ')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
f.is_assign = true
|
f.is_assign = true
|
||||||
f.write(' $node.op.str() ')
|
f.write(' $node.op.str() ')
|
||||||
|
Loading…
Reference in New Issue
Block a user