mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SR-88] Reinstate Mirror migration changes, fix test issues
This reverts commit 182bb7f812.
This commit is contained in:
@@ -29,8 +29,7 @@ public func <(
|
||||
extension String {
|
||||
/// A collection of [Unicode scalar values](http://www.unicode.org/glossary/#unicode_scalar_value) that
|
||||
/// encode a `String` .
|
||||
public struct UnicodeScalarView : CollectionType, _Reflectable,
|
||||
CustomStringConvertible, CustomDebugStringConvertible {
|
||||
public struct UnicodeScalarView : CollectionType, CustomStringConvertible, CustomDebugStringConvertible {
|
||||
init(_ _core: _StringCore) {
|
||||
self._core = _core
|
||||
}
|
||||
@@ -211,12 +210,6 @@ extension String {
|
||||
return Generator(_core)
|
||||
}
|
||||
|
||||
/// Returns a mirror that reflects `self`.
|
||||
@warn_unused_result
|
||||
public func _getMirror() -> _MirrorType {
|
||||
return _UnicodeScalarViewMirror(self)
|
||||
}
|
||||
|
||||
public var description: String {
|
||||
return String(_core[startIndex._position..<endIndex._position])
|
||||
}
|
||||
@@ -413,3 +406,18 @@ extension String.UnicodeScalarIndex {
|
||||
return segmenter.isBoundary(gcb0, gcb1)
|
||||
}
|
||||
}
|
||||
|
||||
// Reflection
|
||||
extension String.UnicodeScalarView : CustomReflectable {
|
||||
/// Returns a mirror that reflects `self`.
|
||||
@warn_unused_result
|
||||
public func customMirror() -> Mirror {
|
||||
return Mirror(self, unlabeledChildren: self)
|
||||
}
|
||||
}
|
||||
|
||||
extension String.UnicodeScalarView : CustomPlaygroundQuickLookable {
|
||||
public func customPlaygroundQuickLook() -> PlaygroundQuickLook {
|
||||
return .Text(description)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user