[String] Use the new value in utf8 setter.

ð
This commit is contained in:
Michael Ilseman
2019-02-06 15:11:17 -08:00
parent 647a29be00
commit a742a62c18
2 changed files with 25 additions and 5 deletions

View File

@@ -241,11 +241,7 @@ extension String {
@inlinable
public var utf8: UTF8View {
@inline(__always) get { return UTF8View(self._guts) }
set {
// TODO(String testing): test suite doesn't currenlty exercise this code at
// all, test it.
self = String(utf8._guts)
}
set { self = String(newValue._guts) }
}
/// A contiguously stored null-terminated UTF-8 representation of the string.