mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ast: fix string interpolation fmt with result call (#15467)
This commit is contained in:
parent
ea163197c7
commit
1dc62a5a66
@ -210,7 +210,7 @@ pub fn (lit &StringInterLiteral) get_fspec_braces(i int) (string, bool) {
|
|||||||
}
|
}
|
||||||
CallExpr {
|
CallExpr {
|
||||||
if sub_expr.args.len != 0 || sub_expr.concrete_types.len != 0
|
if sub_expr.args.len != 0 || sub_expr.concrete_types.len != 0
|
||||||
|| sub_expr.or_block.kind == .propagate_option
|
|| sub_expr.or_block.kind in [.propagate_option, .propagate_result]
|
||||||
|| sub_expr.or_block.stmts.len > 0 {
|
|| sub_expr.or_block.stmts.len > 0 {
|
||||||
needs_braces = true
|
needs_braces = true
|
||||||
} else if sub_expr.left is CallExpr {
|
} else if sub_expr.left is CallExpr {
|
||||||
|
7
vlib/v/fmt/tests/string_intp_with_result_keep.vv
Normal file
7
vlib/v/fmt/tests/string_intp_with_result_keep.vv
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fn err() !u8 {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
println('${err()!}')
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user