diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 3173eb1655..29450772f3 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -522,7 +522,7 @@ pub fn (mut f Fmt) type_decl(node ast.TypeDecl) { } } is_last_arg := i == fn_info.params.len - 1 - should_add_type := is_last_arg || fn_info.params[i + 1].typ != arg.typ || + should_add_type := true || is_last_arg || fn_info.params[i + 1].typ != arg.typ || (fn_info.is_variadic && i == fn_info.params.len - 2) if should_add_type { if fn_info.is_variadic && is_last_arg { diff --git a/vlib/v/fmt/tests/types_expected.vv b/vlib/v/fmt/tests/types_expected.vv index 3150cf1556..9d21c774af 100644 --- a/vlib/v/fmt/tests/types_expected.vv +++ b/vlib/v/fmt/tests/types_expected.vv @@ -19,7 +19,7 @@ type OneArgFn = fn (i int) type TwoDiffArgs = fn (i int, s string) bool -type TwoSameArgs = fn (i, j int) string +type TwoSameArgs = fn (i int, j int) string type VarArgs = fn (s ...string) int