Skip to content

Commit 9d40a05

Browse files
Dave AbrahamsMax Moiseev
authored andcommitted
[stdlib] Deprecate ExpressibleByStringInterpolation
We know its API is inadequate (https://bugs.swift.org/browse/SR-1260?jql=text%20~%20%22StringInterpolationConvertible%22) and don't want to be constrained to supporting it in future versions.
1 parent b3fa41b commit 9d40a05

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

stdlib/public/core/CompilerProtocols.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ public protocol ExpressibleByDictionaryLiteral {
613613
/// String(stringInterpolationSegment: " cookies: $"),
614614
/// String(stringInterpolationSegment: price * number),
615615
/// String(stringInterpolationSegment: "."))
616+
@available(*, deprecated, message: "it will be replaced or redesigned in Swift 4.0. Instead of conforming to 'ExpressibleByStringInterpolation', consider adding an 'init(_:String)'")
616617
public protocol ExpressibleByStringInterpolation {
617618
/// Creates an instance by concatenating the given values.
618619
///

validation-test/stdlib/BoolDiagnostics_Dataflow.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ func test_constantFoldOr4() -> Int {
5555
}
5656
} // expected-error {{missing return in a function expected to return 'Int'}}
5757

58+
// expected-warning@+1 {{'ExpressibleByStringInterpolation' is deprecated: it will be replaced or redesigned in Swift 4.0. Instead of conforming to 'ExpressibleByStringInterpolation', consider adding an 'init(_:String)'}}
59+
typealias X = ExpressibleByStringInterpolation

0 commit comments

Comments
 (0)