Skip to content

Commit e69832f

Browse files
committed
Mention \(literal:) in deprecation message
1 parent a162fa4 commit e69832f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/SwiftSyntaxBuilder/Syntax+StringInterpolation.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ extension SyntaxStringInterpolation: StringInterpolationProtocol {
8282
}
8383

8484
// Append a value of any CustomStringConvertible type as source text.
85-
@available(*, deprecated, renamed: "appendInterpolation(raw:)", message: "use '\\(raw: <value>)' to interpolate a plain string directly into Swift code")
85+
// Deprecated because this can cause code injection bugs (and we want the
86+
// error message to tell users what to do instead).
87+
@available(*, deprecated, renamed: "appendInterpolation(raw:)", message: "use '\\(raw: <value>)' to interpolate a plain string directly into Swift code, or use '\\(literal: <value>)' to add it in a literal")
8688
public mutating func appendInterpolation<T: CustomStringConvertible>(
8789
_ value: T
8890
) {

0 commit comments

Comments
 (0)