@@ -524,53 +524,43 @@ extension String.Index {
524
524
}
525
525
}
526
526
527
- /// A textual representation of this instance.
527
+ /// A textual representation of this instance, intended for debugging .
528
528
///
529
529
/// - Important: The contents of the returned string are not guaranteed to
530
530
/// remain stable: they may arbitrarily change in any Swift release.
531
531
@_alwaysEmitIntoClient // FIXME: Use @backDeployed
532
532
@inline ( never)
533
- public var description : String {
533
+ public var debugDescription : String {
534
534
// 23[utf8]+1
535
535
var d = " \( _encodedOffset) [ \( _encodingDescription) ] "
536
536
if transcodedOffset != 0 {
537
537
d += " + \( transcodedOffset) "
538
538
}
539
539
return d
540
540
}
541
-
542
- /// A textual representation of this instance.
543
- @_alwaysEmitIntoClient
544
- @available ( * , deprecated, renamed: " description " )
545
- public var _description : String {
546
- description
547
- }
548
541
}
549
542
550
543
@available ( SwiftStdlib 6 . 1 , * )
551
- extension String . Index : CustomStringConvertible { }
544
+ extension String . Index : CustomDebugStringConvertible { }
552
545
553
546
extension 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.
555
551
@_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 " )
557
563
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
575
565
}
576
566
}
0 commit comments