diff --git a/vlib/v/parser/containers.v b/vlib/v/parser/containers.v index 92778ab254..9dddfb60b6 100644 --- a/vlib/v/parser/containers.v +++ b/vlib/v/parser/containers.v @@ -94,7 +94,9 @@ fn (mut p Parser) array_init() ast.ArrayInit { } } if exprs.len == 0 && p.tok.kind != .lcbr && has_type { - p.warn_with_pos('use `x := []Type{}` instead of `x := []Type`', first_pos.extend(last_pos)) + if !p.pref.is_fmt { + p.warn_with_pos('use `x := []Type{}` instead of `x := []Type`', first_pos.extend(last_pos)) + } } mut has_len := false mut has_cap := false diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index df1b06a1e1..197f929d82 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -665,7 +665,9 @@ fn (mut p Parser) fn_args() ([]table.Param, bool, bool) { } if p.tok.kind == .key_mut { // TODO remove old syntax - p.warn_with_pos('use `mut f Foo` instead of `f mut Foo`', p.tok.position()) + if !p.pref.is_fmt { + p.warn_with_pos('use `mut f Foo` instead of `f mut Foo`', p.tok.position()) + } is_mut = true } if p.tok.kind == .ellipsis {