fmt: fix string interpolation with CastExpr (#9137)
							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 {
 | 
										} else if sub_expr.left is CallExpr {
 | 
				
			||||||
						sub_expr = sub_expr.left
 | 
											sub_expr = sub_expr.left
 | 
				
			||||||
						continue
 | 
											continue
 | 
				
			||||||
 | 
										} else if sub_expr.left is CastExpr {
 | 
				
			||||||
 | 
											needs_braces = true
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
					break
 | 
										break
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,4 +11,5 @@ fn main() {
 | 
				
			||||||
	eprintln('e: $e')
 | 
						eprintln('e: $e')
 | 
				
			||||||
	_ = ' ${foo.method(bar).str()} '
 | 
						_ = ' ${foo.method(bar).str()} '
 | 
				
			||||||
	println('(${some_struct.@type}, $some_struct.y)')
 | 
						println('(${some_struct.@type}, $some_struct.y)')
 | 
				
			||||||
 | 
						_ := 'CastExpr ${int(d.e).str()}'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue