mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "[Runtime][StdLib] Migrate mirrors to use CustomReflectable API, rewrite dump()"
This reverts commit 9798dfd4aa because it
broke the stdlib build.
This commit is contained in:
@@ -29,7 +29,8 @@ 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, CustomStringConvertible, CustomDebugStringConvertible {
|
||||
public struct UnicodeScalarView : CollectionType, _Reflectable,
|
||||
CustomStringConvertible, CustomDebugStringConvertible {
|
||||
init(_ _core: _StringCore) {
|
||||
self._core = _core
|
||||
}
|
||||
@@ -210,6 +211,12 @@ 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])
|
||||
}
|
||||
@@ -406,18 +413,3 @@ 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, children: _MirrorChildrenCollection(underlying: self))
|
||||
}
|
||||
}
|
||||
|
||||
extension String.UnicodeScalarView : CustomPlaygroundQuickLookable {
|
||||
public func customPlaygroundQuickLook() -> PlaygroundQuickLook {
|
||||
return .Text(description)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user