@@ -110,15 +110,6 @@ extension String {
110
110
arguments: arguments)
111
111
}
112
112
113
- // + (NSString *)pathWithComponents:(NSArray *)components
114
-
115
- /// Returns a string built from the strings in a given array
116
- /// by concatenating them with a path separator between each pair.
117
- @available ( * , unavailable, message: " Use fileURL(withPathComponents:) on URL instead. " )
118
- public static func path( withComponents components: [ String ] ) -> String {
119
- return NSString . path ( withComponents: components)
120
- }
121
-
122
113
//===--------------------------------------------------------------------===//
123
114
// NSString factory functions that have a corresponding constructor
124
115
// are omitted.
@@ -1788,8 +1779,7 @@ extension StringProtocol {
1788
1779
}
1789
1780
1790
1781
// Pre-Swift-3 method names
1791
- extension StringProtocol {
1792
-
1782
+ extension String {
1793
1783
@available ( * , unavailable, renamed: " localizedName(of:) " )
1794
1784
public static func localizedNameOfStringEncoding(
1795
1785
_ encoding: String . Encoding
@@ -1802,6 +1792,18 @@ extension StringProtocol {
1802
1792
fatalError ( " unavailable function can't be called " )
1803
1793
}
1804
1794
1795
+ // + (NSString *)pathWithComponents:(NSArray *)components
1796
+
1797
+ /// Returns a string built from the strings in a given array
1798
+ /// by concatenating them with a path separator between each pair.
1799
+ @available ( * , unavailable, message: " Use fileURL(withPathComponents:) on URL instead. " )
1800
+ public static func path( withComponents components: [ String ] ) -> String {
1801
+ fatalError ( " unavailable function can't be called " )
1802
+ }
1803
+ }
1804
+
1805
+ extension StringProtocol {
1806
+
1805
1807
@available ( * , unavailable, renamed: " canBeConverted(to:) " )
1806
1808
public func canBeConvertedToEncoding( _ encoding: String . Encoding ) -> Bool {
1807
1809
fatalError ( " unavailable function can't be called " )
0 commit comments