mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: fix string interpolation with CastExpr (#9137)
This commit is contained in:
parent
ce92bf8da0
commit
043c29cf95
@ -162,6 +162,8 @@ pub fn (lit &StringInterLiteral) get_fspec_braces(i int) (string, bool) {
|
||||
} else if sub_expr.left is CallExpr {
|
||||
sub_expr = sub_expr.left
|
||||
continue
|
||||
} else if sub_expr.left is CastExpr {
|
||||
needs_braces = true
|
||||
}
|
||||
break
|
||||
}
|
||||
|
@ -11,4 +11,5 @@ fn main() {
|
||||
eprintln('e: $e')
|
||||
_ = ' ${foo.method(bar).str()} '
|
||||
println('(${some_struct.@type}, $some_struct.y)')
|
||||
_ := 'CastExpr ${int(d.e).str()}'
|
||||
}
|
Loading…
Reference in New Issue
Block a user