@@ -524,53 +524,43 @@ extension String.Index {
524524 }
525525 }
526526
527- /// A textual representation of this instance.
527+ /// A textual representation of this instance, intended for debugging .
528528 ///
529529 /// - Important: The contents of the returned string are not guaranteed to
530530 /// remain stable: they may arbitrarily change in any Swift release.
531531 @_alwaysEmitIntoClient // FIXME: Use @backDeployed
532532 @inline ( never)
533- public var description : String {
533+ public var debugDescription : String {
534534 // 23[utf8]+1
535535 var d = " \( _encodedOffset) [ \( _encodingDescription) ] "
536536 if transcodedOffset != 0 {
537537 d += " + \( transcodedOffset) "
538538 }
539539 return d
540540 }
541-
542- /// A textual representation of this instance.
543- @_alwaysEmitIntoClient
544- @available ( * , deprecated, renamed: " description " )
545- public var _description : String {
546- description
547- }
548541}
549542
550543@available ( SwiftStdlib 6 . 1 , * )
551- extension String . Index : CustomStringConvertible { }
544+ extension String . Index : CustomDebugStringConvertible { }
552545
553546extension String . Index {
554- /// A more detailed description of this string index.
547+ /// A textual representation of this instance, intended for debugging.
548+ ///
549+ /// - Important: The contents of the returned string are not guaranteed to
550+ /// remain stable: they may arbitrarily change in any Swift release.
555551 @_alwaysEmitIntoClient
556- @inline ( never)
552+ @available ( * , deprecated, renamed: " debugDescription " )
553+ public var _description : String {
554+ debugDescription
555+ }
556+
557+ /// A textual representation of this instance, intended for debugging.
558+ ///
559+ /// - Important: The contents of the returned string are not guaranteed to
560+ /// remain stable: they may arbitrarily change in any Swift release.
561+ @_alwaysEmitIntoClient
562+ @available ( * , deprecated, renamed: " debugDescription " )
557563 public var _debugDescription : String {
558- /// Note: This would not make a good `debugDescription`; the current
559- /// `description` is fine for that.
560- var d = " String.Index( "
561- d += " offset: \( _encodedOffset) [ \( _encodingDescription) ] "
562- if transcodedOffset != 0 {
563- d += " + \( transcodedOffset) "
564- }
565- if _isCharacterAligned {
566- d += " , aligned: character "
567- } else if _isScalarAligned {
568- d += " , aligned: scalar "
569- }
570- if let stride = characterStride {
571- d += " , stride: \( stride) "
572- }
573- d += " ) "
574- return d
564+ debugDescription
575565 }
576566}
0 commit comments