Skip to content

Commit 72479ac

Browse files
author
Max Moiseev
committed
[overlay] Move static unavailable members back to String
1 parent 5f1c3f7 commit 72479ac

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

stdlib/public/SDK/Foundation/NSStringAPI.swift

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,6 @@ extension String {
110110
arguments: arguments)
111111
}
112112

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-
122113
//===--------------------------------------------------------------------===//
123114
// NSString factory functions that have a corresponding constructor
124115
// are omitted.
@@ -1788,8 +1779,7 @@ extension StringProtocol {
17881779
}
17891780

17901781
// Pre-Swift-3 method names
1791-
extension StringProtocol {
1792-
1782+
extension String {
17931783
@available(*, unavailable, renamed: "localizedName(of:)")
17941784
public static func localizedNameOfStringEncoding(
17951785
_ encoding: String.Encoding
@@ -1802,6 +1792,18 @@ extension StringProtocol {
18021792
fatalError("unavailable function can't be called")
18031793
}
18041794

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+
18051807
@available(*, unavailable, renamed: "canBeConverted(to:)")
18061808
public func canBeConvertedToEncoding(_ encoding: String.Encoding) -> Bool {
18071809
fatalError("unavailable function can't be called")

0 commit comments

Comments
 (0)