@@ -157,7 +157,7 @@ public extension HTMLKitUtilities {
157157 }
158158 var string : String = " "
159159 switch returnType {
160- case . string ( let s ) , . interpolation( let s) : string = s
160+ case . interpolation( let s) : string = s
161161 default : return returnType
162162 }
163163 var remaining_interpolation : Int = returnType. isInterpolation ? 1 : 0 , interpolation : [ ExpressionSegmentSyntax ] = [ ]
@@ -237,17 +237,21 @@ extension HTMLKitUtilities {
237237 ) -> LiteralReturnType ? {
238238 if let stringLiteral: StringLiteralExprSyntax = expression. stringLiteral {
239239 let string : String = stringLiteral. string
240- return stringLiteral. segments. count ( where: { $0. is ( ExpressionSegmentSyntax . self) } ) == 0 ? . string( string) : . interpolation( string)
240+ if stringLiteral. segments. count ( where: { $0. is ( ExpressionSegmentSyntax . self) } ) == 0 {
241+ return . string( string)
242+ } else {
243+ return . interpolation( string)
244+ }
241245 }
242246 if let function: FunctionCallExprSyntax = expression. functionCall {
243- if let decl: String = function. calledExpression. as ( DeclReferenceExprSyntax . self ) ? . baseName. text {
247+ if let decl: String = function. calledExpression. declRef ? . baseName. text {
244248 switch decl {
245249 case " StaticString " :
246250 let string : String = function. arguments. first!. expression. stringLiteral!. string
247251 return . string( string)
248252 default :
249253 if let element: HTMLElement = HTMLElementValueType . parse_element ( context: context, function) {
250- let string : String = element. description
254+ let string : String = String ( describing : element)
251255 return string. contains ( " \\ ( " ) ? . interpolation( string) : . string( string)
252256 }
253257 break
@@ -292,8 +296,8 @@ extension HTMLKitUtilities {
292296 }
293297 return . array( results)
294298 }
295- if let _ : DeclReferenceExprSyntax = expression. as ( DeclReferenceExprSyntax . self) {
296- var string : String = " \( expression ) " , remaining_interpolation : Int = 1
299+ if let decl : DeclReferenceExprSyntax = expression. as ( DeclReferenceExprSyntax . self) {
300+ var string : String = decl . baseName . text , remaining_interpolation : Int = 1
297301 warn_interpolation ( context: context, node: expression, string: & string, remaining_interpolation: & remaining_interpolation, lookupFiles: lookupFiles)
298302 if remaining_interpolation > 0 {
299303 return . interpolation( " \\ ( " + string + " ) " )
0 commit comments