Skip to content

Commit f6f0c1c

Browse files
committed
Add workaround to avoid WordPressOrgXMLRPCApiErrorDomain redefinition
1 parent 277f0ca commit f6f0c1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/CoreAPI/WordPressOrgXMLRPCApi.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,13 @@ private class SessionDelegate: NSObject, URLSessionDelegate {
289289
}
290290
}
291291

292+
// Hack to avoid the Swift compiler generating a domain constant for us that would then conflict with the one we define in APIInterface.
293+
// The automatic generation occurs, as far as I can tell, because of @objc and Error, neither of which we can remove.
294+
// Reminder: We define our own constant for the domain so that we can conform WordPressOrgXMLRPCApiError to CustomNSError.
295+
typealias WordPressOrgXMLRPCApiError = WordPressOrgXMLRPCAPIError
296+
292297
/// Error constants for the WordPress XML-RPC API
293-
@objc public enum WordPressOrgXMLRPCApiError: Int, Error, CaseIterable {
298+
@objc public enum WordPressOrgXMLRPCAPIError: Int, Error, CaseIterable {
294299
/// An error HTTP status code was returned.
295300
case httpErrorStatusCode
296301
/// The serialization of the request failed.

0 commit comments

Comments
 (0)