Revert "Replace concrete init(stringInterpolationSegment:)'s with generic ones"
This reverts commit d993a517f9e2651043b39ab67ce9e94c0d6c51ff. It
caused the source-compatibility regression in SR-3842 /
rdar://problem/30340537.
diff --git a/stdlib/public/core/StringInterpolation.swift.gyb b/stdlib/public/core/StringInterpolation.swift.gyb
index e54aeb8..b8062a1 100644
--- a/stdlib/public/core/StringInterpolation.swift.gyb
+++ b/stdlib/public/core/StringInterpolation.swift.gyb
@@ -68,35 +68,29 @@
self = String(describing: expr)
}
+% for Type in StreamableTypes:
/// Creates a string containing the given value's textual representation.
///
/// Do not call this initializer directly. It is used by the compiler when
/// interpreting string interpolations.
///
/// - SeeAlso: `ExpressibleByStringInterpolation`
- public init<T: TextOutputStreamable> (stringInterpolationSegment expr: T) {
+ public init(stringInterpolationSegment expr: ${Type}) {
self = _toStringReadOnlyStreamable(expr)
}
+% end
+% for Type in PrintableTypes:
/// Creates a string containing the given value's textual representation.
///
/// Do not call this initializer directly. It is used by the compiler when
/// interpreting string interpolations.
///
/// - SeeAlso: `ExpressibleByStringInterpolation`
- public init<T: CustomStringConvertible> (stringInterpolationSegment expr: T) {
+ public init(stringInterpolationSegment expr: ${Type}) {
self = _toStringReadOnlyPrintable(expr)
}
-
- /// Creates a string containing the given value's textual representation.
- ///
- /// Do not call this initializer directly. It is used by the compiler when
- /// interpreting string interpolations.
- ///
- /// - SeeAlso: `ExpressibleByStringInterpolation`
- public init<T: TextOutputStreamable & CustomStringConvertible> (stringInterpolationSegment expr: T) {
- self = _toStringReadOnlyStreamable(expr)
- }
+% end
}
// ${'Local Variables'}:
diff --git a/test/api-digester/source-stability.swift.expected b/test/api-digester/source-stability.swift.expected
index 86e7300..afef4ce 100644
--- a/test/api-digester/source-stability.swift.expected
+++ b/test/api-digester/source-stability.swift.expected
@@ -12,7 +12,6 @@
Protocol MutableIndexable has been removed (deprecated)
Protocol RandomAccessIndexable has been removed (deprecated)
Protocol RangeReplaceableIndexable has been removed (deprecated)
-Constructor String.init(stringInterpolationSegment:) has been removed
Func Array.append(contentsOf:) has been removed
Func ArraySlice.append(contentsOf:) has been removed
Func ContiguousArray.append(contentsOf:) has been removed
@@ -35,7 +34,6 @@
Constructor RangeReplaceableRandomAccessSlice.init(base:bounds:) has 2nd parameter type change from Range<Base.Index> to Range<RangeReplaceableRandomAccessSlice.Index>
Constructor RangeReplaceableSlice.init(base:bounds:) has 2nd parameter type change from Range<Base.Index> to Range<RangeReplaceableSlice.Index>
Constructor Slice.init(base:bounds:) has 2nd parameter type change from Range<Base.Index> to Range<Slice.Index>
-Constructor String.init(stringInterpolationSegment:) has 1st parameter type change from String to T
Func AnyBidirectionalCollection.makeIterator() has return type change from AnyIterator<Element> to AnyBidirectionalCollection.Iterator
Func AnyCollection.makeIterator() has return type change from AnyIterator<Element> to AnyCollection.Iterator
Func AnyRandomAccessCollection.makeIterator() has return type change from AnyIterator<Element> to AnyRandomAccessCollection.Iterator
diff --git a/validation-test/Sema/interpolation_placeholders.swift b/validation-test/Sema/interpolation_placeholders.swift
deleted file mode 100644
index 519d3cb..0000000
--- a/validation-test/Sema/interpolation_placeholders.swift
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: not %target-swift-frontend -typecheck %s
-
-let query = "<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)&<#...#>=\(<#...#>)"
-