diff --git a/vlib/v/ast/str.v b/vlib/v/ast/str.v index b0a16641be..b7129d374a 100644 --- a/vlib/v/ast/str.v +++ b/vlib/v/ast/str.v @@ -201,7 +201,7 @@ pub fn (lit &StringInterLiteral) get_fspec_braces(i int) (string, bool) { break } CallExpr { - if sub_expr.args.len != 0 { + if sub_expr.args.len != 0 || sub_expr.concrete_types.len != 0 { needs_braces = true } else if sub_expr.left is CallExpr { sub_expr = sub_expr.left diff --git a/vlib/v/fmt/tests/string_interpolation_keep.vv b/vlib/v/fmt/tests/string_interpolation_keep.vv index 97a1ff58d4..62c82a1814 100644 --- a/vlib/v/fmt/tests/string_interpolation_keep.vv +++ b/vlib/v/fmt/tests/string_interpolation_keep.vv @@ -14,4 +14,6 @@ fn main() { println('(${some_struct.@type}, $some_struct.y)') _ := 'CastExpr ${int(d.e).str()}' println('${f[0..4].bytestr()}') + _ := '${generic_fn()}' + _ := '${foo.generic_method()}' }