fmt: keep braces around @ escaped fields in string interpolation (#8488)
parent
8b0401a46f
commit
43676330ba
|
@ -165,6 +165,10 @@ pub fn (lit &StringInterLiteral) get_fspec_braces(i int) (string, bool) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
SelectorExpr {
|
SelectorExpr {
|
||||||
|
if sub_expr.field_name[0] == `@` {
|
||||||
|
needs_braces = true
|
||||||
|
break
|
||||||
|
}
|
||||||
sub_expr = sub_expr.expr
|
sub_expr = sub_expr.expr
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,5 @@ fn main() {
|
||||||
println('a: $a $b xxx')
|
println('a: $a $b xxx')
|
||||||
eprintln('e: $e')
|
eprintln('e: $e')
|
||||||
_ = ' ${foo.method(bar).str()} '
|
_ = ' ${foo.method(bar).str()} '
|
||||||
|
println('(${some_struct.@type}, $some_struct.y)')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue