@@ -483,8 +483,9 @@ extension Substring.${_View} : BidirectionalCollection {
483
483
}
484
484
}
485
485
486
- extension Substring {
487
486
% if View == 'CharacterView':
487
+ @available(swift, deprecated: 3.2)
488
+ extension Substring {
488
489
@inlinable // FIXME(sil-serialize-all)
489
490
@available(swift, deprecated: 3.2, message:
490
491
"Please use String or Substring directly")
@@ -496,8 +497,20 @@ extension Substring {
496
497
_characters = newValue
497
498
}
498
499
}
500
+
501
+ /// Creates a Substring having the given content.
502
+ ///
503
+ /// - Complexity: O(1)
504
+ @inlinable // FIXME(sil-serialize-all)
505
+ @available(swift, deprecated: 3.2, message:
506
+ "Please use String or Substring directly")
507
+ public init(_ content: ${View}) {
508
+ self = content._wholeString[content.startIndex..<content.endIndex]
509
+ }
510
+ }
499
511
% end
500
512
513
+ extension Substring {
501
514
@inlinable // FIXME(sil-serialize-all)
502
515
public var ${_property}: ${_View} {
503
516
get {
@@ -508,13 +521,15 @@ extension Substring {
508
521
}
509
522
}
510
523
524
+ % if View != 'CharacterView':
511
525
/// Creates a Substring having the given content.
512
526
///
513
527
/// - Complexity: O(1)
514
528
@inlinable // FIXME(sil-serialize-all)
515
529
public init(_ content: ${View}) {
516
530
self = content._wholeString[content.startIndex..<content.endIndex]
517
531
}
532
+ % end
518
533
}
519
534
520
535
extension String {
0 commit comments