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

fmt: fix unnecessary line break in array init (fix #11448) (#11562)

This commit is contained in:
yuyi
2021-09-21 21:20:09 +08:00
committed by GitHub
parent d6fa6a459c
commit 108a01d65f
47 changed files with 532 additions and 518 deletions

View File

@@ -984,8 +984,7 @@ fn (mut p Parser) closure_vars() []ast.Param {
fn (mut p Parser) check_fn_mutable_arguments(typ ast.Type, pos token.Position) {
sym := p.table.get_type_symbol(typ)
if sym.kind in [.array, .array_fixed, .interface_, .map, .placeholder, .struct_, .generic_inst,
.sum_type,
] {
.sum_type] {
return
}
if typ.is_ptr() || typ.is_pointer() {

View File

@@ -528,12 +528,14 @@ fn (mut p Parser) interface_decl() ast.InterfaceDecl {
}
// field_names << name
args2, _, is_variadic := p.fn_args() // TODO merge ast.Param and ast.Arg to avoid this
mut args := [ast.Param{
name: 'x'
is_mut: is_mut
typ: typ
is_hidden: true
}]
mut args := [
ast.Param{
name: 'x'
is_mut: is_mut
typ: typ
is_hidden: true
},
]
args << args2
mut method := ast.FnDecl{
name: name