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

fmt: fix a bug that break generics call in string inter (#11468)

This commit is contained in:
zakuro 2021-09-11 10:47:22 +09:00 committed by GitHub
parent 145467050d
commit fb20a92b1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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<int>()}'
_ := '${foo.generic_method<int>()}'
}