Build Information
Failed to build RealHTTP, reference 1.9.0 (fcec34
), with Swift 6.0 for Linux on 15 Jan 2025 15:41:23 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-4606859-1":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu 2>&1
Build Log
34 |
35 | // MARK: - Overrides
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:54: error: cannot find type 'URLRequest' in scope
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:32: error: method does not override any method from its superclass
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:77: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:62: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:32: error: method does not override any method from its superclass
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: method does not override any method from its superclass
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:69: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:94: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:32: error: method does not override any method from its superclass
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:35: error: cannot find type 'URLRequest' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLRequest' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:91: error: cannot find type 'URLProtocolClient' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:21: error: initializer does not override a designated initializer from its superclass
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: initializer does not override a designated initializer from its superclass
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:63: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:83: error: cannot find type 'URLProtocolClient' in scope
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:23: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:55: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:72:26: error: method does not override any method from its superclass
70 | }
71 |
72 | public override func startLoading() {
| `- error: method does not override any method from its superclass
73 | var request = self.request
74 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:135:26: error: method does not override any method from its superclass
133 | }
134 |
135 | public override func stopLoading() {
| `- error: method does not override any method from its superclass
136 | responseWorkItem?.cancel()
137 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:142:49: error: cannot find type 'URLRequest' in scope
140 |
141 | private func streamData(_ inputStream: InputStream,
142 | forRequest request: URLRequest, forStub stub: HTTPStubResponse,
| `- error: cannot find type 'URLRequest' in scope
143 | speed: HTTPConnectionSpeed,
144 | completion: @escaping ((Error?) -> Void)) {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:43: error: cannot find type 'URLRequest' in scope
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: cannot find type 'URLRequest' in scope
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:105: error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
Foundation.HTTPCookieStorage:2:18: note: 'HTTPCookieStorage' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPCookieStorage = AnyObject
| `- note: 'HTTPCookieStorage' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:21:35: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
19 | import Foundation
20 |
21 | public class HTTPStubURLProtocol: URLProtocol {
| `- error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
22 |
23 | /// This class support only certain common type of schemes.
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLProtocol = AnyObject
| `- note: 'URLProtocol' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:64:9: error: 'super' members cannot be referenced in a root class
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
65 | }
66 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:68:9: error: 'super' members cannot be referenced in a root class
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
69 | self.urlSessionTask = task
70 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:73:28: error: value of type 'HTTPStubURLProtocol' has no member 'request'
71 |
72 | public override func startLoading() {
73 | var request = self.request
| `- error: value of type 'HTTPStubURLProtocol' has no member 'request'
74 |
75 | // Get the cookie storage that applies to this request.
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:76:47: error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
74 |
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
| `- error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
77 | if let session = task?.value(forKey: "session") as? URLSession,
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:77:32: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
77 | if let session = task?.value(forKey: "session") as? URLSession,
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
79 | cookieStorage = configurationCookieStorage
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:87:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
85 | request.allHTTPHeaderFields = [String: String]()
86 | }
87 | request.allHTTPHeaderFields!.merge(HTTPCookie.requestHeaderFields(with: cookies)) { (current, _) in
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
88 | current
89 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:99:13: error: cannot find 'client' in scope
97 | request.url != nil else {
98 | // If not found we throw an error
99 | client?.urlProtocol(self, didFailWithError: HTTPStubberErrors.matchStubNotFound(request))
| `- error: cannot find 'client' in scope
100 | return
101 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:119:22: error: value of type 'HTTPStubURLProtocol' has no member 'client'
117 |
118 | guard data.count > 0, inputStream.hasBytesAvailable else {
119 | self.client?.urlProtocol(self, didLoad: Data())
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
120 | inputStream.close()
121 | return
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:176:26: error: value of type 'HTTPStubURLProtocol' has no member 'client'
174 | // adjust slotTime proportionally to the bytes remaining
175 | DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + timingInfo.slotTime) {
176 | self.client?.urlProtocol(self, didLoad: data)
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
177 | self.streamData(inputStream, forRequest: request, forStub: stub, speed: speed, completion: completion)
178 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:193:39: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
195 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:194:17: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:197:13: error: cannot find 'client' in scope
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
197 | client?.urlProtocol(self, didFailWithError: failureError)
| `- error: cannot find 'client' in scope
198 | return
199 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:202:24: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
200 |
201 | let statusCode = stubResponse.statusCode
202 | let response = HTTPURLResponse(url: url,
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:204:53: error: 'nil' requires a contextual type
202 | let response = HTTPURLResponse(url: url,
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
| `- error: 'nil' requires a contextual type
205 | headerFields: headers)
206 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:215:28: error: cannot find 'URLRequest' in scope
213 | // Includes redirection call to client.
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
| `- error: cannot find 'URLRequest' in scope
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:216:48: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:217:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:219:13: error: cannot find 'client' in scope
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
| `- error: cannot find 'client' in scope
220 | }
221 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:9: error: cannot find 'client' in scope
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot find 'client' in scope
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:79: error: cannot infer contextual base in reference to member 'notAllowed'
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot infer contextual base in reference to member 'notAllowed'
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:225:13: error: cannot find 'client' in scope
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
| `- error: cannot find 'client' in scope
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:227:9: error: cannot find 'client' in scope
225 | client?.urlProtocol(self, didLoad: data)
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
| `- error: cannot find 'client' in scope
228 | }
229 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:25:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
23 |
24 | func load() {
25 | URLProtocol.registerClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
26 | }
27 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:29:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
27 |
28 | func unload() {
29 | URLProtocol.unregisterClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
30 | }
31 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:41:40: error: cannot find type 'Selector' in scope
39 | }
40 |
41 | private func originalSelector() -> Selector {
| `- error: cannot find type 'Selector' in scope
42 | #selector(getter: URLSessionConfiguration.protocolClasses)
43 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:45:6: error: Objective-C interoperability is disabled
43 | }
44 |
45 | @objc private func protocolClasses() -> [AnyClass] {
| `- error: Objective-C interoperability is disabled
46 | [HTTPStubURLProtocol.self]
47 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:26:28: error: cannot find 'class_getInstanceMethod' in scope
24 |
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
| `- error: cannot find 'class_getInstanceMethod' in scope
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
28 | fatalError("Could not load URLSessionHook")
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:26: error: cannot find 'class_getInstanceMethod' in scope
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: cannot find 'class_getInstanceMethod' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:71: error: '#selector' can only be used with the Objective-C runtime
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: '#selector' can only be used with the Objective-C runtime
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:30:9: error: cannot find 'method_exchangeImplementations' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
30 | method_exchangeImplementations(method, stub)
| `- error: cannot find 'method_exchangeImplementations' in scope
31 | }
32 |
[76/80] Compiling RealHTTP HTTPStubberErrors.swift
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:189:53: error: cannot find type 'URLRequest' in scope
187 | /// - Parameter request: url request to check.
188 | /// - Returns: HTTPSubRequest?
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
| `- error: cannot find type 'URLRequest' in scope
190 | stubbedRequests.first {
191 | $0.match(request)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:199:41: error: cannot find type 'URLRequest' in scope
197 | /// - Parameter request: request to check.
198 | /// - Returns: Bool
199 | public func shouldHandle(_ request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
200 | switch unhandledMode {
201 | case .optin:
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest.swift:50:37: error: cannot find type 'URLRequest' in scope
48 | /// - Parameter urlRequest: url request.
49 | /// - Returns: Bool
50 | public func match(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
51 | for matcher in matchers {
52 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Matchers/Built-In Matchers/HTTPStubCustomMatcher.swift:22:33: error: cannot find type 'URLRequest' in scope
20 |
21 | public struct HTTPStubCustomMatcher: HTTPStubMatcher {
22 | public typealias Handler = (URLRequest, HTTPMatcherSource) -> Bool
| `- error: cannot find type 'URLRequest' in scope
23 |
24 | // MARK: - Private Properties
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest+Matchers.swift:36:42: error: @escaping attribute only applies to function types
34 | /// - Parameter matcherFunction: matcher function.
35 | /// - Returns: Self
36 | public func match(_ matcherFunction: @escaping HTTPStubCustomMatcher.Handler) -> Self {
| `- error: @escaping attribute only applies to function types
37 | let matcher = HTTPStubCustomMatcher(matcherFunction)
38 | return match(matcher)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:191:16: error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
190 | stubbedRequests.first {
191 | $0.match(request)
| `- error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
192 | }
193 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/HTTPStubIgnoreRule.swift:83:41: error: cannot find type 'URLRequest' in scope
81 | // MARK: - Internal Functions
82 |
83 | internal func matches(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
84 | for matcher in matchers {
85 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubberErrors.swift:22:28: error: cannot find type 'URLRequest' in scope
20 |
21 | public enum HTTPStubberErrors: Error {
22 | case matchStubNotFound(URLRequest)
| `- error: cannot find type 'URLRequest' in scope
23 | }
24 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:25: error: property does not override any property from its superclass
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: property does not override any property from its superclass
30 | urlSessionTask
31 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:31: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
30 | urlSessionTask
31 | }
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:33:33: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 | }
32 |
33 | private var urlSessionTask: URLSessionTask?
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
34 |
35 | // MARK: - Overrides
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:54: error: cannot find type 'URLRequest' in scope
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:32: error: method does not override any method from its superclass
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:77: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:62: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:32: error: method does not override any method from its superclass
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: method does not override any method from its superclass
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:69: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:94: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:32: error: method does not override any method from its superclass
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:35: error: cannot find type 'URLRequest' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLRequest' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:91: error: cannot find type 'URLProtocolClient' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:21: error: initializer does not override a designated initializer from its superclass
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: initializer does not override a designated initializer from its superclass
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:63: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:83: error: cannot find type 'URLProtocolClient' in scope
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:23: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:55: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:72:26: error: method does not override any method from its superclass
70 | }
71 |
72 | public override func startLoading() {
| `- error: method does not override any method from its superclass
73 | var request = self.request
74 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:135:26: error: method does not override any method from its superclass
133 | }
134 |
135 | public override func stopLoading() {
| `- error: method does not override any method from its superclass
136 | responseWorkItem?.cancel()
137 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:142:49: error: cannot find type 'URLRequest' in scope
140 |
141 | private func streamData(_ inputStream: InputStream,
142 | forRequest request: URLRequest, forStub stub: HTTPStubResponse,
| `- error: cannot find type 'URLRequest' in scope
143 | speed: HTTPConnectionSpeed,
144 | completion: @escaping ((Error?) -> Void)) {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:43: error: cannot find type 'URLRequest' in scope
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: cannot find type 'URLRequest' in scope
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:105: error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
Foundation.HTTPCookieStorage:2:18: note: 'HTTPCookieStorage' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPCookieStorage = AnyObject
| `- note: 'HTTPCookieStorage' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:21:35: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
19 | import Foundation
20 |
21 | public class HTTPStubURLProtocol: URLProtocol {
| `- error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
22 |
23 | /// This class support only certain common type of schemes.
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLProtocol = AnyObject
| `- note: 'URLProtocol' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:64:9: error: 'super' members cannot be referenced in a root class
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
65 | }
66 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:68:9: error: 'super' members cannot be referenced in a root class
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
69 | self.urlSessionTask = task
70 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:73:28: error: value of type 'HTTPStubURLProtocol' has no member 'request'
71 |
72 | public override func startLoading() {
73 | var request = self.request
| `- error: value of type 'HTTPStubURLProtocol' has no member 'request'
74 |
75 | // Get the cookie storage that applies to this request.
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:76:47: error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
74 |
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
| `- error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
77 | if let session = task?.value(forKey: "session") as? URLSession,
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:77:32: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
77 | if let session = task?.value(forKey: "session") as? URLSession,
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
79 | cookieStorage = configurationCookieStorage
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:87:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
85 | request.allHTTPHeaderFields = [String: String]()
86 | }
87 | request.allHTTPHeaderFields!.merge(HTTPCookie.requestHeaderFields(with: cookies)) { (current, _) in
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
88 | current
89 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:99:13: error: cannot find 'client' in scope
97 | request.url != nil else {
98 | // If not found we throw an error
99 | client?.urlProtocol(self, didFailWithError: HTTPStubberErrors.matchStubNotFound(request))
| `- error: cannot find 'client' in scope
100 | return
101 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:119:22: error: value of type 'HTTPStubURLProtocol' has no member 'client'
117 |
118 | guard data.count > 0, inputStream.hasBytesAvailable else {
119 | self.client?.urlProtocol(self, didLoad: Data())
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
120 | inputStream.close()
121 | return
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:176:26: error: value of type 'HTTPStubURLProtocol' has no member 'client'
174 | // adjust slotTime proportionally to the bytes remaining
175 | DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + timingInfo.slotTime) {
176 | self.client?.urlProtocol(self, didLoad: data)
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
177 | self.streamData(inputStream, forRequest: request, forStub: stub, speed: speed, completion: completion)
178 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:193:39: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
195 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:194:17: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:197:13: error: cannot find 'client' in scope
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
197 | client?.urlProtocol(self, didFailWithError: failureError)
| `- error: cannot find 'client' in scope
198 | return
199 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:202:24: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
200 |
201 | let statusCode = stubResponse.statusCode
202 | let response = HTTPURLResponse(url: url,
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:204:53: error: 'nil' requires a contextual type
202 | let response = HTTPURLResponse(url: url,
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
| `- error: 'nil' requires a contextual type
205 | headerFields: headers)
206 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:215:28: error: cannot find 'URLRequest' in scope
213 | // Includes redirection call to client.
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
| `- error: cannot find 'URLRequest' in scope
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:216:48: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:217:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:219:13: error: cannot find 'client' in scope
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
| `- error: cannot find 'client' in scope
220 | }
221 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:9: error: cannot find 'client' in scope
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot find 'client' in scope
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:79: error: cannot infer contextual base in reference to member 'notAllowed'
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot infer contextual base in reference to member 'notAllowed'
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:225:13: error: cannot find 'client' in scope
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
| `- error: cannot find 'client' in scope
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:227:9: error: cannot find 'client' in scope
225 | client?.urlProtocol(self, didLoad: data)
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
| `- error: cannot find 'client' in scope
228 | }
229 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:25:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
23 |
24 | func load() {
25 | URLProtocol.registerClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
26 | }
27 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:29:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
27 |
28 | func unload() {
29 | URLProtocol.unregisterClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
30 | }
31 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:41:40: error: cannot find type 'Selector' in scope
39 | }
40 |
41 | private func originalSelector() -> Selector {
| `- error: cannot find type 'Selector' in scope
42 | #selector(getter: URLSessionConfiguration.protocolClasses)
43 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:45:6: error: Objective-C interoperability is disabled
43 | }
44 |
45 | @objc private func protocolClasses() -> [AnyClass] {
| `- error: Objective-C interoperability is disabled
46 | [HTTPStubURLProtocol.self]
47 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:26:28: error: cannot find 'class_getInstanceMethod' in scope
24 |
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
| `- error: cannot find 'class_getInstanceMethod' in scope
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
28 | fatalError("Could not load URLSessionHook")
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:26: error: cannot find 'class_getInstanceMethod' in scope
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: cannot find 'class_getInstanceMethod' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:71: error: '#selector' can only be used with the Objective-C runtime
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: '#selector' can only be used with the Objective-C runtime
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:30:9: error: cannot find 'method_exchangeImplementations' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
30 | method_exchangeImplementations(method, stub)
| `- error: cannot find 'method_exchangeImplementations' in scope
31 | }
32 |
[77/80] Compiling RealHTTP HTTPStubHookProtocol.swift
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:189:53: error: cannot find type 'URLRequest' in scope
187 | /// - Parameter request: url request to check.
188 | /// - Returns: HTTPSubRequest?
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
| `- error: cannot find type 'URLRequest' in scope
190 | stubbedRequests.first {
191 | $0.match(request)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:199:41: error: cannot find type 'URLRequest' in scope
197 | /// - Parameter request: request to check.
198 | /// - Returns: Bool
199 | public func shouldHandle(_ request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
200 | switch unhandledMode {
201 | case .optin:
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest.swift:50:37: error: cannot find type 'URLRequest' in scope
48 | /// - Parameter urlRequest: url request.
49 | /// - Returns: Bool
50 | public func match(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
51 | for matcher in matchers {
52 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Matchers/Built-In Matchers/HTTPStubCustomMatcher.swift:22:33: error: cannot find type 'URLRequest' in scope
20 |
21 | public struct HTTPStubCustomMatcher: HTTPStubMatcher {
22 | public typealias Handler = (URLRequest, HTTPMatcherSource) -> Bool
| `- error: cannot find type 'URLRequest' in scope
23 |
24 | // MARK: - Private Properties
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest+Matchers.swift:36:42: error: @escaping attribute only applies to function types
34 | /// - Parameter matcherFunction: matcher function.
35 | /// - Returns: Self
36 | public func match(_ matcherFunction: @escaping HTTPStubCustomMatcher.Handler) -> Self {
| `- error: @escaping attribute only applies to function types
37 | let matcher = HTTPStubCustomMatcher(matcherFunction)
38 | return match(matcher)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:191:16: error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
190 | stubbedRequests.first {
191 | $0.match(request)
| `- error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
192 | }
193 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/HTTPStubIgnoreRule.swift:83:41: error: cannot find type 'URLRequest' in scope
81 | // MARK: - Internal Functions
82 |
83 | internal func matches(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
84 | for matcher in matchers {
85 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubberErrors.swift:22:28: error: cannot find type 'URLRequest' in scope
20 |
21 | public enum HTTPStubberErrors: Error {
22 | case matchStubNotFound(URLRequest)
| `- error: cannot find type 'URLRequest' in scope
23 | }
24 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:25: error: property does not override any property from its superclass
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: property does not override any property from its superclass
30 | urlSessionTask
31 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:31: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
30 | urlSessionTask
31 | }
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:33:33: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 | }
32 |
33 | private var urlSessionTask: URLSessionTask?
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
34 |
35 | // MARK: - Overrides
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:54: error: cannot find type 'URLRequest' in scope
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:32: error: method does not override any method from its superclass
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:77: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:62: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:32: error: method does not override any method from its superclass
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: method does not override any method from its superclass
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:69: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:94: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:32: error: method does not override any method from its superclass
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:35: error: cannot find type 'URLRequest' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLRequest' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:91: error: cannot find type 'URLProtocolClient' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:21: error: initializer does not override a designated initializer from its superclass
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: initializer does not override a designated initializer from its superclass
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:63: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:83: error: cannot find type 'URLProtocolClient' in scope
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:23: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:55: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:72:26: error: method does not override any method from its superclass
70 | }
71 |
72 | public override func startLoading() {
| `- error: method does not override any method from its superclass
73 | var request = self.request
74 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:135:26: error: method does not override any method from its superclass
133 | }
134 |
135 | public override func stopLoading() {
| `- error: method does not override any method from its superclass
136 | responseWorkItem?.cancel()
137 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:142:49: error: cannot find type 'URLRequest' in scope
140 |
141 | private func streamData(_ inputStream: InputStream,
142 | forRequest request: URLRequest, forStub stub: HTTPStubResponse,
| `- error: cannot find type 'URLRequest' in scope
143 | speed: HTTPConnectionSpeed,
144 | completion: @escaping ((Error?) -> Void)) {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:43: error: cannot find type 'URLRequest' in scope
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: cannot find type 'URLRequest' in scope
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:105: error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
Foundation.HTTPCookieStorage:2:18: note: 'HTTPCookieStorage' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPCookieStorage = AnyObject
| `- note: 'HTTPCookieStorage' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:21:35: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
19 | import Foundation
20 |
21 | public class HTTPStubURLProtocol: URLProtocol {
| `- error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
22 |
23 | /// This class support only certain common type of schemes.
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLProtocol = AnyObject
| `- note: 'URLProtocol' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:64:9: error: 'super' members cannot be referenced in a root class
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
65 | }
66 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:68:9: error: 'super' members cannot be referenced in a root class
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
69 | self.urlSessionTask = task
70 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:73:28: error: value of type 'HTTPStubURLProtocol' has no member 'request'
71 |
72 | public override func startLoading() {
73 | var request = self.request
| `- error: value of type 'HTTPStubURLProtocol' has no member 'request'
74 |
75 | // Get the cookie storage that applies to this request.
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:76:47: error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
74 |
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
| `- error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
77 | if let session = task?.value(forKey: "session") as? URLSession,
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:77:32: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
77 | if let session = task?.value(forKey: "session") as? URLSession,
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
79 | cookieStorage = configurationCookieStorage
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:87:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
85 | request.allHTTPHeaderFields = [String: String]()
86 | }
87 | request.allHTTPHeaderFields!.merge(HTTPCookie.requestHeaderFields(with: cookies)) { (current, _) in
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
88 | current
89 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:99:13: error: cannot find 'client' in scope
97 | request.url != nil else {
98 | // If not found we throw an error
99 | client?.urlProtocol(self, didFailWithError: HTTPStubberErrors.matchStubNotFound(request))
| `- error: cannot find 'client' in scope
100 | return
101 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:119:22: error: value of type 'HTTPStubURLProtocol' has no member 'client'
117 |
118 | guard data.count > 0, inputStream.hasBytesAvailable else {
119 | self.client?.urlProtocol(self, didLoad: Data())
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
120 | inputStream.close()
121 | return
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:176:26: error: value of type 'HTTPStubURLProtocol' has no member 'client'
174 | // adjust slotTime proportionally to the bytes remaining
175 | DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + timingInfo.slotTime) {
176 | self.client?.urlProtocol(self, didLoad: data)
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
177 | self.streamData(inputStream, forRequest: request, forStub: stub, speed: speed, completion: completion)
178 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:193:39: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
195 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:194:17: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:197:13: error: cannot find 'client' in scope
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
197 | client?.urlProtocol(self, didFailWithError: failureError)
| `- error: cannot find 'client' in scope
198 | return
199 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:202:24: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
200 |
201 | let statusCode = stubResponse.statusCode
202 | let response = HTTPURLResponse(url: url,
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:204:53: error: 'nil' requires a contextual type
202 | let response = HTTPURLResponse(url: url,
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
| `- error: 'nil' requires a contextual type
205 | headerFields: headers)
206 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:215:28: error: cannot find 'URLRequest' in scope
213 | // Includes redirection call to client.
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
| `- error: cannot find 'URLRequest' in scope
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:216:48: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:217:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:219:13: error: cannot find 'client' in scope
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
| `- error: cannot find 'client' in scope
220 | }
221 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:9: error: cannot find 'client' in scope
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot find 'client' in scope
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:79: error: cannot infer contextual base in reference to member 'notAllowed'
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot infer contextual base in reference to member 'notAllowed'
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:225:13: error: cannot find 'client' in scope
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
| `- error: cannot find 'client' in scope
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:227:9: error: cannot find 'client' in scope
225 | client?.urlProtocol(self, didLoad: data)
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
| `- error: cannot find 'client' in scope
228 | }
229 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:25:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
23 |
24 | func load() {
25 | URLProtocol.registerClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
26 | }
27 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:29:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
27 |
28 | func unload() {
29 | URLProtocol.unregisterClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
30 | }
31 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:41:40: error: cannot find type 'Selector' in scope
39 | }
40 |
41 | private func originalSelector() -> Selector {
| `- error: cannot find type 'Selector' in scope
42 | #selector(getter: URLSessionConfiguration.protocolClasses)
43 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:45:6: error: Objective-C interoperability is disabled
43 | }
44 |
45 | @objc private func protocolClasses() -> [AnyClass] {
| `- error: Objective-C interoperability is disabled
46 | [HTTPStubURLProtocol.self]
47 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:26:28: error: cannot find 'class_getInstanceMethod' in scope
24 |
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
| `- error: cannot find 'class_getInstanceMethod' in scope
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
28 | fatalError("Could not load URLSessionHook")
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:26: error: cannot find 'class_getInstanceMethod' in scope
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: cannot find 'class_getInstanceMethod' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:71: error: '#selector' can only be used with the Objective-C runtime
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: '#selector' can only be used with the Objective-C runtime
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:30:9: error: cannot find 'method_exchangeImplementations' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
30 | method_exchangeImplementations(method, stub)
| `- error: cannot find 'method_exchangeImplementations' in scope
31 | }
32 |
[78/80] Compiling RealHTTP HTTPStubURLProtocol.swift
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:189:53: error: cannot find type 'URLRequest' in scope
187 | /// - Parameter request: url request to check.
188 | /// - Returns: HTTPSubRequest?
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
| `- error: cannot find type 'URLRequest' in scope
190 | stubbedRequests.first {
191 | $0.match(request)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:199:41: error: cannot find type 'URLRequest' in scope
197 | /// - Parameter request: request to check.
198 | /// - Returns: Bool
199 | public func shouldHandle(_ request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
200 | switch unhandledMode {
201 | case .optin:
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest.swift:50:37: error: cannot find type 'URLRequest' in scope
48 | /// - Parameter urlRequest: url request.
49 | /// - Returns: Bool
50 | public func match(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
51 | for matcher in matchers {
52 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Matchers/Built-In Matchers/HTTPStubCustomMatcher.swift:22:33: error: cannot find type 'URLRequest' in scope
20 |
21 | public struct HTTPStubCustomMatcher: HTTPStubMatcher {
22 | public typealias Handler = (URLRequest, HTTPMatcherSource) -> Bool
| `- error: cannot find type 'URLRequest' in scope
23 |
24 | // MARK: - Private Properties
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest+Matchers.swift:36:42: error: @escaping attribute only applies to function types
34 | /// - Parameter matcherFunction: matcher function.
35 | /// - Returns: Self
36 | public func match(_ matcherFunction: @escaping HTTPStubCustomMatcher.Handler) -> Self {
| `- error: @escaping attribute only applies to function types
37 | let matcher = HTTPStubCustomMatcher(matcherFunction)
38 | return match(matcher)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:191:16: error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
190 | stubbedRequests.first {
191 | $0.match(request)
| `- error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
192 | }
193 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/HTTPStubIgnoreRule.swift:83:41: error: cannot find type 'URLRequest' in scope
81 | // MARK: - Internal Functions
82 |
83 | internal func matches(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
84 | for matcher in matchers {
85 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubberErrors.swift:22:28: error: cannot find type 'URLRequest' in scope
20 |
21 | public enum HTTPStubberErrors: Error {
22 | case matchStubNotFound(URLRequest)
| `- error: cannot find type 'URLRequest' in scope
23 | }
24 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:25: error: property does not override any property from its superclass
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: property does not override any property from its superclass
30 | urlSessionTask
31 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:31: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
30 | urlSessionTask
31 | }
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:33:33: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 | }
32 |
33 | private var urlSessionTask: URLSessionTask?
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
34 |
35 | // MARK: - Overrides
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:54: error: cannot find type 'URLRequest' in scope
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:32: error: method does not override any method from its superclass
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:77: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:62: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:32: error: method does not override any method from its superclass
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: method does not override any method from its superclass
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:69: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:94: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:32: error: method does not override any method from its superclass
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:35: error: cannot find type 'URLRequest' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLRequest' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:91: error: cannot find type 'URLProtocolClient' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:21: error: initializer does not override a designated initializer from its superclass
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: initializer does not override a designated initializer from its superclass
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:63: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:83: error: cannot find type 'URLProtocolClient' in scope
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:23: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:55: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:72:26: error: method does not override any method from its superclass
70 | }
71 |
72 | public override func startLoading() {
| `- error: method does not override any method from its superclass
73 | var request = self.request
74 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:135:26: error: method does not override any method from its superclass
133 | }
134 |
135 | public override func stopLoading() {
| `- error: method does not override any method from its superclass
136 | responseWorkItem?.cancel()
137 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:142:49: error: cannot find type 'URLRequest' in scope
140 |
141 | private func streamData(_ inputStream: InputStream,
142 | forRequest request: URLRequest, forStub stub: HTTPStubResponse,
| `- error: cannot find type 'URLRequest' in scope
143 | speed: HTTPConnectionSpeed,
144 | completion: @escaping ((Error?) -> Void)) {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:43: error: cannot find type 'URLRequest' in scope
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: cannot find type 'URLRequest' in scope
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:105: error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
Foundation.HTTPCookieStorage:2:18: note: 'HTTPCookieStorage' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPCookieStorage = AnyObject
| `- note: 'HTTPCookieStorage' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:21:35: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
19 | import Foundation
20 |
21 | public class HTTPStubURLProtocol: URLProtocol {
| `- error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
22 |
23 | /// This class support only certain common type of schemes.
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLProtocol = AnyObject
| `- note: 'URLProtocol' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:64:9: error: 'super' members cannot be referenced in a root class
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
65 | }
66 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:68:9: error: 'super' members cannot be referenced in a root class
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
69 | self.urlSessionTask = task
70 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:73:28: error: value of type 'HTTPStubURLProtocol' has no member 'request'
71 |
72 | public override func startLoading() {
73 | var request = self.request
| `- error: value of type 'HTTPStubURLProtocol' has no member 'request'
74 |
75 | // Get the cookie storage that applies to this request.
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:76:47: error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
74 |
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
| `- error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
77 | if let session = task?.value(forKey: "session") as? URLSession,
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:77:32: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
77 | if let session = task?.value(forKey: "session") as? URLSession,
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
79 | cookieStorage = configurationCookieStorage
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:87:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
85 | request.allHTTPHeaderFields = [String: String]()
86 | }
87 | request.allHTTPHeaderFields!.merge(HTTPCookie.requestHeaderFields(with: cookies)) { (current, _) in
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
88 | current
89 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:99:13: error: cannot find 'client' in scope
97 | request.url != nil else {
98 | // If not found we throw an error
99 | client?.urlProtocol(self, didFailWithError: HTTPStubberErrors.matchStubNotFound(request))
| `- error: cannot find 'client' in scope
100 | return
101 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:119:22: error: value of type 'HTTPStubURLProtocol' has no member 'client'
117 |
118 | guard data.count > 0, inputStream.hasBytesAvailable else {
119 | self.client?.urlProtocol(self, didLoad: Data())
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
120 | inputStream.close()
121 | return
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:176:26: error: value of type 'HTTPStubURLProtocol' has no member 'client'
174 | // adjust slotTime proportionally to the bytes remaining
175 | DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + timingInfo.slotTime) {
176 | self.client?.urlProtocol(self, didLoad: data)
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
177 | self.streamData(inputStream, forRequest: request, forStub: stub, speed: speed, completion: completion)
178 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:193:39: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
195 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:194:17: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:197:13: error: cannot find 'client' in scope
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
197 | client?.urlProtocol(self, didFailWithError: failureError)
| `- error: cannot find 'client' in scope
198 | return
199 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:202:24: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
200 |
201 | let statusCode = stubResponse.statusCode
202 | let response = HTTPURLResponse(url: url,
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:204:53: error: 'nil' requires a contextual type
202 | let response = HTTPURLResponse(url: url,
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
| `- error: 'nil' requires a contextual type
205 | headerFields: headers)
206 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:215:28: error: cannot find 'URLRequest' in scope
213 | // Includes redirection call to client.
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
| `- error: cannot find 'URLRequest' in scope
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:216:48: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:217:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:219:13: error: cannot find 'client' in scope
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
| `- error: cannot find 'client' in scope
220 | }
221 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:9: error: cannot find 'client' in scope
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot find 'client' in scope
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:79: error: cannot infer contextual base in reference to member 'notAllowed'
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot infer contextual base in reference to member 'notAllowed'
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:225:13: error: cannot find 'client' in scope
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
| `- error: cannot find 'client' in scope
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:227:9: error: cannot find 'client' in scope
225 | client?.urlProtocol(self, didLoad: data)
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
| `- error: cannot find 'client' in scope
228 | }
229 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:25:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
23 |
24 | func load() {
25 | URLProtocol.registerClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
26 | }
27 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:29:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
27 |
28 | func unload() {
29 | URLProtocol.unregisterClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
30 | }
31 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:41:40: error: cannot find type 'Selector' in scope
39 | }
40 |
41 | private func originalSelector() -> Selector {
| `- error: cannot find type 'Selector' in scope
42 | #selector(getter: URLSessionConfiguration.protocolClasses)
43 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:45:6: error: Objective-C interoperability is disabled
43 | }
44 |
45 | @objc private func protocolClasses() -> [AnyClass] {
| `- error: Objective-C interoperability is disabled
46 | [HTTPStubURLProtocol.self]
47 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:26:28: error: cannot find 'class_getInstanceMethod' in scope
24 |
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
| `- error: cannot find 'class_getInstanceMethod' in scope
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
28 | fatalError("Could not load URLSessionHook")
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:26: error: cannot find 'class_getInstanceMethod' in scope
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: cannot find 'class_getInstanceMethod' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:71: error: '#selector' can only be used with the Objective-C runtime
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: '#selector' can only be used with the Objective-C runtime
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:30:9: error: cannot find 'method_exchangeImplementations' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
30 | method_exchangeImplementations(method, stub)
| `- error: cannot find 'method_exchangeImplementations' in scope
31 | }
32 |
[79/80] Compiling RealHTTP URLHook.swift
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:189:53: error: cannot find type 'URLRequest' in scope
187 | /// - Parameter request: url request to check.
188 | /// - Returns: HTTPSubRequest?
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
| `- error: cannot find type 'URLRequest' in scope
190 | stubbedRequests.first {
191 | $0.match(request)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:199:41: error: cannot find type 'URLRequest' in scope
197 | /// - Parameter request: request to check.
198 | /// - Returns: Bool
199 | public func shouldHandle(_ request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
200 | switch unhandledMode {
201 | case .optin:
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest.swift:50:37: error: cannot find type 'URLRequest' in scope
48 | /// - Parameter urlRequest: url request.
49 | /// - Returns: Bool
50 | public func match(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
51 | for matcher in matchers {
52 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Matchers/Built-In Matchers/HTTPStubCustomMatcher.swift:22:33: error: cannot find type 'URLRequest' in scope
20 |
21 | public struct HTTPStubCustomMatcher: HTTPStubMatcher {
22 | public typealias Handler = (URLRequest, HTTPMatcherSource) -> Bool
| `- error: cannot find type 'URLRequest' in scope
23 |
24 | // MARK: - Private Properties
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest+Matchers.swift:36:42: error: @escaping attribute only applies to function types
34 | /// - Parameter matcherFunction: matcher function.
35 | /// - Returns: Self
36 | public func match(_ matcherFunction: @escaping HTTPStubCustomMatcher.Handler) -> Self {
| `- error: @escaping attribute only applies to function types
37 | let matcher = HTTPStubCustomMatcher(matcherFunction)
38 | return match(matcher)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:191:16: error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
190 | stubbedRequests.first {
191 | $0.match(request)
| `- error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
192 | }
193 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/HTTPStubIgnoreRule.swift:83:41: error: cannot find type 'URLRequest' in scope
81 | // MARK: - Internal Functions
82 |
83 | internal func matches(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
84 | for matcher in matchers {
85 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubberErrors.swift:22:28: error: cannot find type 'URLRequest' in scope
20 |
21 | public enum HTTPStubberErrors: Error {
22 | case matchStubNotFound(URLRequest)
| `- error: cannot find type 'URLRequest' in scope
23 | }
24 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:25: error: property does not override any property from its superclass
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: property does not override any property from its superclass
30 | urlSessionTask
31 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:31: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
30 | urlSessionTask
31 | }
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:33:33: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 | }
32 |
33 | private var urlSessionTask: URLSessionTask?
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
34 |
35 | // MARK: - Overrides
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:54: error: cannot find type 'URLRequest' in scope
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:32: error: method does not override any method from its superclass
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:77: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:62: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:32: error: method does not override any method from its superclass
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: method does not override any method from its superclass
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:69: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:94: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:32: error: method does not override any method from its superclass
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:35: error: cannot find type 'URLRequest' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLRequest' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:91: error: cannot find type 'URLProtocolClient' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:21: error: initializer does not override a designated initializer from its superclass
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: initializer does not override a designated initializer from its superclass
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:63: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:83: error: cannot find type 'URLProtocolClient' in scope
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:23: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:55: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:72:26: error: method does not override any method from its superclass
70 | }
71 |
72 | public override func startLoading() {
| `- error: method does not override any method from its superclass
73 | var request = self.request
74 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:135:26: error: method does not override any method from its superclass
133 | }
134 |
135 | public override func stopLoading() {
| `- error: method does not override any method from its superclass
136 | responseWorkItem?.cancel()
137 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:142:49: error: cannot find type 'URLRequest' in scope
140 |
141 | private func streamData(_ inputStream: InputStream,
142 | forRequest request: URLRequest, forStub stub: HTTPStubResponse,
| `- error: cannot find type 'URLRequest' in scope
143 | speed: HTTPConnectionSpeed,
144 | completion: @escaping ((Error?) -> Void)) {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:43: error: cannot find type 'URLRequest' in scope
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: cannot find type 'URLRequest' in scope
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:105: error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
Foundation.HTTPCookieStorage:2:18: note: 'HTTPCookieStorage' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPCookieStorage = AnyObject
| `- note: 'HTTPCookieStorage' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:21:35: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
19 | import Foundation
20 |
21 | public class HTTPStubURLProtocol: URLProtocol {
| `- error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
22 |
23 | /// This class support only certain common type of schemes.
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLProtocol = AnyObject
| `- note: 'URLProtocol' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:64:9: error: 'super' members cannot be referenced in a root class
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
65 | }
66 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:68:9: error: 'super' members cannot be referenced in a root class
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
69 | self.urlSessionTask = task
70 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:73:28: error: value of type 'HTTPStubURLProtocol' has no member 'request'
71 |
72 | public override func startLoading() {
73 | var request = self.request
| `- error: value of type 'HTTPStubURLProtocol' has no member 'request'
74 |
75 | // Get the cookie storage that applies to this request.
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:76:47: error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
74 |
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
| `- error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
77 | if let session = task?.value(forKey: "session") as? URLSession,
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:77:32: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
77 | if let session = task?.value(forKey: "session") as? URLSession,
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
79 | cookieStorage = configurationCookieStorage
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:87:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
85 | request.allHTTPHeaderFields = [String: String]()
86 | }
87 | request.allHTTPHeaderFields!.merge(HTTPCookie.requestHeaderFields(with: cookies)) { (current, _) in
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
88 | current
89 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:99:13: error: cannot find 'client' in scope
97 | request.url != nil else {
98 | // If not found we throw an error
99 | client?.urlProtocol(self, didFailWithError: HTTPStubberErrors.matchStubNotFound(request))
| `- error: cannot find 'client' in scope
100 | return
101 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:119:22: error: value of type 'HTTPStubURLProtocol' has no member 'client'
117 |
118 | guard data.count > 0, inputStream.hasBytesAvailable else {
119 | self.client?.urlProtocol(self, didLoad: Data())
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
120 | inputStream.close()
121 | return
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:176:26: error: value of type 'HTTPStubURLProtocol' has no member 'client'
174 | // adjust slotTime proportionally to the bytes remaining
175 | DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + timingInfo.slotTime) {
176 | self.client?.urlProtocol(self, didLoad: data)
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
177 | self.streamData(inputStream, forRequest: request, forStub: stub, speed: speed, completion: completion)
178 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:193:39: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
195 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:194:17: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:197:13: error: cannot find 'client' in scope
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
197 | client?.urlProtocol(self, didFailWithError: failureError)
| `- error: cannot find 'client' in scope
198 | return
199 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:202:24: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
200 |
201 | let statusCode = stubResponse.statusCode
202 | let response = HTTPURLResponse(url: url,
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:204:53: error: 'nil' requires a contextual type
202 | let response = HTTPURLResponse(url: url,
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
| `- error: 'nil' requires a contextual type
205 | headerFields: headers)
206 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:215:28: error: cannot find 'URLRequest' in scope
213 | // Includes redirection call to client.
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
| `- error: cannot find 'URLRequest' in scope
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:216:48: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:217:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:219:13: error: cannot find 'client' in scope
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
| `- error: cannot find 'client' in scope
220 | }
221 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:9: error: cannot find 'client' in scope
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot find 'client' in scope
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:79: error: cannot infer contextual base in reference to member 'notAllowed'
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot infer contextual base in reference to member 'notAllowed'
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:225:13: error: cannot find 'client' in scope
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
| `- error: cannot find 'client' in scope
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:227:9: error: cannot find 'client' in scope
225 | client?.urlProtocol(self, didLoad: data)
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
| `- error: cannot find 'client' in scope
228 | }
229 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:25:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
23 |
24 | func load() {
25 | URLProtocol.registerClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
26 | }
27 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:29:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
27 |
28 | func unload() {
29 | URLProtocol.unregisterClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
30 | }
31 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:41:40: error: cannot find type 'Selector' in scope
39 | }
40 |
41 | private func originalSelector() -> Selector {
| `- error: cannot find type 'Selector' in scope
42 | #selector(getter: URLSessionConfiguration.protocolClasses)
43 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:45:6: error: Objective-C interoperability is disabled
43 | }
44 |
45 | @objc private func protocolClasses() -> [AnyClass] {
| `- error: Objective-C interoperability is disabled
46 | [HTTPStubURLProtocol.self]
47 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:26:28: error: cannot find 'class_getInstanceMethod' in scope
24 |
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
| `- error: cannot find 'class_getInstanceMethod' in scope
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
28 | fatalError("Could not load URLSessionHook")
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:26: error: cannot find 'class_getInstanceMethod' in scope
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: cannot find 'class_getInstanceMethod' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:71: error: '#selector' can only be used with the Objective-C runtime
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: '#selector' can only be used with the Objective-C runtime
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:30:9: error: cannot find 'method_exchangeImplementations' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
30 | method_exchangeImplementations(method, stub)
| `- error: cannot find 'method_exchangeImplementations' in scope
31 | }
32 |
[80/80] Compiling RealHTTP URLSessionHook.swift
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:189:53: error: cannot find type 'URLRequest' in scope
187 | /// - Parameter request: url request to check.
188 | /// - Returns: HTTPSubRequest?
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
| `- error: cannot find type 'URLRequest' in scope
190 | stubbedRequests.first {
191 | $0.match(request)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:199:41: error: cannot find type 'URLRequest' in scope
197 | /// - Parameter request: request to check.
198 | /// - Returns: Bool
199 | public func shouldHandle(_ request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
200 | switch unhandledMode {
201 | case .optin:
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest.swift:50:37: error: cannot find type 'URLRequest' in scope
48 | /// - Parameter urlRequest: url request.
49 | /// - Returns: Bool
50 | public func match(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
51 | for matcher in matchers {
52 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Matchers/Built-In Matchers/HTTPStubCustomMatcher.swift:22:33: error: cannot find type 'URLRequest' in scope
20 |
21 | public struct HTTPStubCustomMatcher: HTTPStubMatcher {
22 | public typealias Handler = (URLRequest, HTTPMatcherSource) -> Bool
| `- error: cannot find type 'URLRequest' in scope
23 |
24 | // MARK: - Private Properties
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/Stub Request/HTTPStubRequest+Matchers.swift:36:42: error: @escaping attribute only applies to function types
34 | /// - Parameter matcherFunction: matcher function.
35 | /// - Returns: Self
36 | public func match(_ matcherFunction: @escaping HTTPStubCustomMatcher.Handler) -> Self {
| `- error: @escaping attribute only applies to function types
37 | let matcher = HTTPStubCustomMatcher(matcherFunction)
38 | return match(matcher)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubber.swift:191:16: error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
189 | internal func suitableStubForRequest(_ request: URLRequest) -> HTTPStubRequest? {
190 | stubbedRequests.first {
191 | $0.match(request)
| `- error: cannot convert value of type 'HTTPStubRequest' to closure result type 'Bool'
192 | }
193 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/DataTypes/HTTPStubIgnoreRule.swift:83:41: error: cannot find type 'URLRequest' in scope
81 | // MARK: - Internal Functions
82 |
83 | internal func matches(_ urlRequest: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
84 | for matcher in matchers {
85 | if matcher.matches(request: urlRequest, for: self) == false {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/HTTPStubberErrors.swift:22:28: error: cannot find type 'URLRequest' in scope
20 |
21 | public enum HTTPStubberErrors: Error {
22 | case matchStubNotFound(URLRequest)
| `- error: cannot find type 'URLRequest' in scope
23 | }
24 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:25: error: property does not override any property from its superclass
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: property does not override any property from its superclass
30 | urlSessionTask
31 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:29:31: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
27 | private var responseWorkItem: DispatchWorkItem?
28 |
29 | public override var task: URLSessionTask? {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
30 | urlSessionTask
31 | }
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:33:33: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 | }
32 |
33 | private var urlSessionTask: URLSessionTask?
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
34 |
35 | // MARK: - Overrides
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:54: error: cannot find type 'URLRequest' in scope
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:44:32: error: method does not override any method from its superclass
42 | /// - Parameter request: request to validate.
43 | /// - Returns: Bool
44 | public override class func canInit(with request: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
45 | guard let scheme = request.url?.scheme,
46 | Self.supportedSchemes.contains(scheme) else {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:77: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:62: error: cannot find type 'URLRequest' in scope
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: cannot find type 'URLRequest' in scope
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:54:32: error: method does not override any method from its superclass
52 | }
53 |
54 | public override class func canonicalRequest(for request: URLRequest) -> URLRequest {
| `- error: method does not override any method from its superclass
55 | request
56 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:69: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:94: error: cannot find type 'URLRequest' in scope
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: cannot find type 'URLRequest' in scope
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:58:32: error: method does not override any method from its superclass
56 | }
57 |
58 | public override class func requestIsCacheEquivalent(_ requestA: URLRequest, to requestB: URLRequest) -> Bool {
| `- error: method does not override any method from its superclass
59 | false
60 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:35: error: cannot find type 'URLRequest' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLRequest' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:91: error: cannot find type 'URLProtocolClient' in scope
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:21: error: initializer does not override a designated initializer from its superclass
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: initializer does not override a designated initializer from its superclass
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:63:63: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
61 |
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
65 | }
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:83: error: cannot find type 'URLProtocolClient' in scope
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: cannot find type 'URLProtocolClient' in scope
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:23: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:67:55: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
65 | }
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
69 | self.urlSessionTask = task
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:72:26: error: method does not override any method from its superclass
70 | }
71 |
72 | public override func startLoading() {
| `- error: method does not override any method from its superclass
73 | var request = self.request
74 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:135:26: error: method does not override any method from its superclass
133 | }
134 |
135 | public override func stopLoading() {
| `- error: method does not override any method from its superclass
136 | responseWorkItem?.cancel()
137 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:142:49: error: cannot find type 'URLRequest' in scope
140 |
141 | private func streamData(_ inputStream: InputStream,
142 | forRequest request: URLRequest, forStub stub: HTTPStubResponse,
| `- error: cannot find type 'URLRequest' in scope
143 | speed: HTTPConnectionSpeed,
144 | completion: @escaping ((Error?) -> Void)) {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:43: error: cannot find type 'URLRequest' in scope
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: cannot find type 'URLRequest' in scope
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:190:105: error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
188 | }
189 |
190 | private func finishRequest(_ request: URLRequest, withStub stubResponse: HTTPStubResponse, cookies: HTTPCookieStorage) {
| `- error: 'HTTPCookieStorage' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
Foundation.HTTPCookieStorage:2:18: note: 'HTTPCookieStorage' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPCookieStorage = AnyObject
| `- note: 'HTTPCookieStorage' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:21:35: error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
19 | import Foundation
20 |
21 | public class HTTPStubURLProtocol: URLProtocol {
| `- error: 'URLProtocol' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
22 |
23 | /// This class support only certain common type of schemes.
Foundation.URLProtocol:2:18: note: 'URLProtocol' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLProtocol = AnyObject
| `- note: 'URLProtocol' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:64:9: error: 'super' members cannot be referenced in a root class
62 | // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
63 | public override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
64 | super.init(request: request, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
65 | }
66 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:68:9: error: 'super' members cannot be referenced in a root class
66 |
67 | public init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
68 | super.init(request: task.currentRequest!, cachedResponse: cachedResponse, client: client)
| `- error: 'super' members cannot be referenced in a root class
69 | self.urlSessionTask = task
70 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:73:28: error: value of type 'HTTPStubURLProtocol' has no member 'request'
71 |
72 | public override func startLoading() {
73 | var request = self.request
| `- error: value of type 'HTTPStubURLProtocol' has no member 'request'
74 |
75 | // Get the cookie storage that applies to this request.
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:76:47: error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
74 |
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
| `- error: type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'shared'
77 | if let session = task?.value(forKey: "session") as? URLSession,
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:77:32: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
75 | // Get the cookie storage that applies to this request.
76 | var cookieStorage = HTTPCookieStorage.shared
77 | if let session = task?.value(forKey: "session") as? URLSession,
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'value'
78 | let configurationCookieStorage = session.configuration.httpCookieStorage {
79 | cookieStorage = configurationCookieStorage
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:87:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
85 | request.allHTTPHeaderFields = [String: String]()
86 | }
87 | request.allHTTPHeaderFields!.merge(HTTPCookie.requestHeaderFields(with: cookies)) { (current, _) in
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
88 | current
89 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:99:13: error: cannot find 'client' in scope
97 | request.url != nil else {
98 | // If not found we throw an error
99 | client?.urlProtocol(self, didFailWithError: HTTPStubberErrors.matchStubNotFound(request))
| `- error: cannot find 'client' in scope
100 | return
101 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:119:22: error: value of type 'HTTPStubURLProtocol' has no member 'client'
117 |
118 | guard data.count > 0, inputStream.hasBytesAvailable else {
119 | self.client?.urlProtocol(self, didLoad: Data())
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
120 | inputStream.close()
121 | return
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:176:26: error: value of type 'HTTPStubURLProtocol' has no member 'client'
174 | // adjust slotTime proportionally to the bytes remaining
175 | DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + timingInfo.slotTime) {
176 | self.client?.urlProtocol(self, didLoad: data)
| `- error: value of type 'HTTPStubURLProtocol' has no member 'client'
177 | self.streamData(inputStream, forRequest: request, forStub: stub, speed: speed, completion: completion)
178 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:193:39: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
191 | let url = request.url!
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'cookies'
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
195 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:194:17: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
192 | let headers = stubResponse.headers.asDictionary
193 | let cookiesToSet = HTTPCookie.cookies(withResponseHeaderFields: headers, for: url)
194 | cookies.setCookies(cookiesToSet, for: request.url!, mainDocumentURL: url)
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'setCookies'
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:197:13: error: cannot find 'client' in scope
195 |
196 | if let failureError = stubResponse.failError { // request should fail with given error
197 | client?.urlProtocol(self, didFailWithError: failureError)
| `- error: cannot find 'client' in scope
198 | return
199 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:202:24: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
200 |
201 | let statusCode = stubResponse.statusCode
202 | let response = HTTPURLResponse(url: url,
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:204:53: error: 'nil' requires a contextual type
202 | let response = HTTPURLResponse(url: url,
203 | statusCode: statusCode.rawValue,
204 | httpVersion: nil,
| `- error: 'nil' requires a contextual type
205 | headerFields: headers)
206 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:215:28: error: cannot find 'URLRequest' in scope
213 | // Includes redirection call to client.
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
| `- error: cannot find 'URLRequest' in scope
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:216:48: error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
214 | // A redirect to the client must contain `Location:<URL>` inside the body.
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
| `- error: value of type 'HTTPCookieStorage' (aka 'AnyObject') has no member 'cookies'
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:217:59: error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
215 | var redirect = URLRequest(url: location)
216 | if let cookiesInRedirect = cookies.cookies(for: url) {
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
| `- error: type 'HTTPCookie' (aka 'AnyObject') has no member 'requestHeaderFields'
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:219:13: error: cannot find 'client' in scope
217 | redirect.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesInRedirect)
218 | }
219 | client?.urlProtocol(self, wasRedirectedTo: redirect, redirectResponse: response!)
| `- error: cannot find 'client' in scope
220 | }
221 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:9: error: cannot find 'client' in scope
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot find 'client' in scope
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:223:79: error: cannot infer contextual base in reference to member 'notAllowed'
221 |
222 | // Send response
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
| `- error: cannot infer contextual base in reference to member 'notAllowed'
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:225:13: error: cannot find 'client' in scope
223 | client?.urlProtocol(self, didReceive: response!, cacheStoragePolicy: .notAllowed)
224 | if let data = stubResponse.body?.data {
225 | client?.urlProtocol(self, didLoad: data)
| `- error: cannot find 'client' in scope
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/HTTPStubURLProtocol.swift:227:9: error: cannot find 'client' in scope
225 | client?.urlProtocol(self, didLoad: data)
226 | }
227 | client?.urlProtocolDidFinishLoading(self)
| `- error: cannot find 'client' in scope
228 | }
229 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:25:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
23 |
24 | func load() {
25 | URLProtocol.registerClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'registerClass'
26 | }
27 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLHook.swift:29:21: error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
27 |
28 | func unload() {
29 | URLProtocol.unregisterClass(HTTPStubURLProtocol.self)
| `- error: type 'URLProtocol' (aka 'AnyObject') has no member 'unregisterClass'
30 | }
31 |
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:41:40: error: cannot find type 'Selector' in scope
39 | }
40 |
41 | private func originalSelector() -> Selector {
| `- error: cannot find type 'Selector' in scope
42 | #selector(getter: URLSessionConfiguration.protocolClasses)
43 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:45:6: error: Objective-C interoperability is disabled
43 | }
44 |
45 | @objc private func protocolClasses() -> [AnyClass] {
| `- error: Objective-C interoperability is disabled
46 | [HTTPStubURLProtocol.self]
47 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:26:28: error: cannot find 'class_getInstanceMethod' in scope
24 |
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
| `- error: cannot find 'class_getInstanceMethod' in scope
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
28 | fatalError("Could not load URLSessionHook")
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:26: error: cannot find 'class_getInstanceMethod' in scope
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: cannot find 'class_getInstanceMethod' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:27:71: error: '#selector' can only be used with the Objective-C runtime
25 | func load() {
26 | guard let method = class_getInstanceMethod(originalClass(), originalSelector()),
27 | let stub = class_getInstanceMethod(URLSessionHook.self, #selector(protocolClasses)) else {
| `- error: '#selector' can only be used with the Objective-C runtime
28 | fatalError("Could not load URLSessionHook")
29 | }
/host/spi-builder-workspace/Sources/RealHTTP/Stubber/Hooks/URLSessionHook.swift:30:9: error: cannot find 'method_exchangeImplementations' in scope
28 | fatalError("Could not load URLSessionHook")
29 | }
30 | method_exchangeImplementations(method, stub)
| `- error: cannot find 'method_exchangeImplementations' in scope
31 | }
32 |
BUILD FAILURE 6.0 linux