Implementation of the SE-130 proposal.

It replaces String initializers taking Character or UnicodeScalar as a repeating value by a more general initializer that takes a String as a repeating value. This is done to avoid the ambiguities in the current String API, which can be only resolved by explicit casting.
String.append(_:UnicodeScalar) APIs is also removed to match these changes.
This commit is contained in:
Roman Levenstein
2016-07-25 23:12:20 -07:00
parent 8887175db8
commit a798852cb4
5 changed files with 69 additions and 31 deletions

View File

@@ -651,8 +651,9 @@ extension String {
///
/// - Complexity: Appending a Unicode scalar to a string averages to O(1)
/// over many additions.
@available(*, unavailable, message: "Replaced by append(_: String)")
public mutating func append(_ x: UnicodeScalar) {
_core.append(x)
Builtin.unreachable()
}
public // SPI(Foundation)