Build Information
Failed to build SwiftStack, reference master (3ed8ed
), with Swift 6.2 (beta) for Android on 18 Jun 2025 15:23:17 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-4606859-1":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:android-6.2-latest swift build --swift-sdk aarch64-unknown-linux-android28 2>&1
Build Log
========================================
RunAll
========================================
Builder version: 4.64.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/sobotics/swiftstack.git
Reference: master
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
From https://github.com/sobotics/swiftstack
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
HEAD is now at 3ed8edd [tests] import FoundationNetworking
Cloned https://github.com/sobotics/swiftstack.git
Revision (git rev-parse @):
3ed8eddf8bcf3984d8e7a8b9890802b544f4ef28
SUCCESS checkout https://github.com/sobotics/swiftstack.git at master
========================================
Build
========================================
Selected platform: android
Swift version: 6.2
Building package at path: $PWD
https://github.com/sobotics/swiftstack.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4606859-1":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:android-6.2-latest swift build --swift-sdk aarch64-unknown-linux-android28 2>&1
android-6.2-latest: Pulling from finestructure/spi-images
Digest: sha256:b7c4a6b4153ff40ef9277e2157e708f835b8eb011095d53bd8db4594eb2b7798
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:android-6.2-latest
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-8C5A4AE7A8CE2BA.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[3/24] Emitting module SwiftStack
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:42:20: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
40 |
41 | ///The URLSession for this client.
42 | open var session: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
43 |
44 | ///The queue used for asynchronous operations.
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:207:38: error: cannot find type 'URLRequest' in scope
205 | ///- parameter request: The request to perform.
206 | ///- returns: The data and response returned by the request.
207 | open func performRequest(_ request: URLRequest) throws -> (Data, HTTPURLResponse) {
| `- error: cannot find type 'URLRequest' in scope
208 | let req = request
209 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:207:67: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
205 | ///- parameter request: The request to perform.
206 | ///- returns: The data and response returned by the request.
207 | open func performRequest(_ request: URLRequest) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
208 | let req = request
209 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:240:48: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
238 | ///- parameter url: The URL to send the request to.
239 | ///- returns: The data and response returned by the request.
240 | open func get(_ url: String) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
241 | guard let nsUrl = URL(string: url) else {
242 | throw RequestError.invalidURL(url: url)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:256:74: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
254 | ///
255 | ///- returns: The data and response returned by the request.
256 | open func post(_ url: String, fields: [String:String]) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
257 | guard let nsUrl = URL(string: url) else {
258 | throw RequestError.invalidURL(url: url)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:305:38: error: cannot find type 'URLRequest' in scope
303 | ///- parameter request: The request to perform.
304 | ///- returns: The text returned by the request.
305 | open func performRequest(_ request: URLRequest) throws -> String {
| `- error: cannot find type 'URLRequest' in scope
306 | let (data, _) = try performRequest(request)
307 | guard let string = String(data: data, encoding: String.Encoding.utf8) else {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:397:13: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
395 | //MARK: - Task management
396 | internal class HTTPTask {
397 | var task: URLSessionTask
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
399 |
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/SwiftStack/APIClient.swift:398:27: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
396 | internal class HTTPTask {
397 | var task: URLSessionTask
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
399 |
400 | var request: URLRequest!
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:400:16: error: cannot find type 'URLRequest' in scope
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
399 |
400 | var request: URLRequest!
| `- error: cannot find type 'URLRequest' in scope
401 |
402 | var data: Data?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:403:17: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
401 |
402 | var data: Data?
403 | var response: HTTPURLResponse?
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:406:39: error: cannot find type 'URLRequest' in scope
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: cannot find type 'URLRequest' in scope
407 | self.task = task
408 | self.completion = completion
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:406:14: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
407 | self.task = task
408 | self.completion = completion
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/SwiftStack/APIClient.swift:406:82: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
407 | self.task = task
408 | self.completion = completion
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:418:61: error: cannot find type 'URLRequest' in scope
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: cannot find type 'URLRequest' in scope
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:418:36: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
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/SwiftStack/APIClient.swift:418:104: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:433:44: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
434 |
435 | guard let task = tasks[dataTask] else {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:430:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
428 | //MARK: - URLSession delegate methods
429 | public func urlSession(
430 | _ session: URLSession,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:431:13: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
429 | public func urlSession(
430 | _ session: URLSession,
431 | dataTask: URLSessionDataTask,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
432 | didReceive response: URLResponse,
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:432:24: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
430 | _ session: URLSession,
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
434 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:451:36: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
449 | }
450 |
451 | public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
452 | guard let task = tasks[dataTask] else {
453 | print("\(dataTask) is not in client task list; ignoring")
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:451:58: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
449 | }
450 |
451 | public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
452 | guard let task = tasks[dataTask] else {
453 | print("\(dataTask) is not in client task list; ignoring")
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:465:36: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
463 | }
464 |
465 | public func urlSession(_ session: URLSession, task sessionTask: URLSessionTask, didCompleteWithError error: Error?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
466 | guard let task = tasks[sessionTask] else {
467 | print("\(sessionTask) is not in client task list; ignoring")
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:465:66: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
463 | }
464 |
465 | public func urlSession(_ session: URLSession, task sessionTask: URLSessionTask, didCompleteWithError error: Error?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
466 | guard let task = tasks[sessionTask] else {
467 | print("\(sessionTask) is not in client task list; ignoring")
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/SwiftStack/APIClient.swift:482:23: error: cannot find type 'URLRequest' in scope
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
| `- error: cannot find type 'URLRequest' in scope
483 | completionHandler: @escaping (URLRequest?) -> Void
484 | ) {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:483:33: error: cannot find type 'URLRequest' in scope
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
483 | completionHandler: @escaping (URLRequest?) -> Void
| `- error: cannot find type 'URLRequest' in scope
484 | ) {
485 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:479:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
477 |
478 | public func urlSession(
479 | _ session: URLSession,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:480:9: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
478 | public func urlSession(
479 | _ session: URLSession,
480 | task: URLSessionTask,
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
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/SwiftStack/APIClient.swift:481:40: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
479 | _ session: URLSession,
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
482 | newRequest request: URLRequest,
483 | completionHandler: @escaping (URLRequest?) -> Void
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:38:33: error: cannot find type 'URLSessionDataDelegate' in scope
36 |
37 | ///An APIClient communicates to the Stack Exchange API over HTTP.
38 | open class APIClient: NSObject, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
39 | //MARK: Instance variables and types.
40 |
[4/27] Compiling SwiftStack APIClient.swift
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:42:20: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
40 |
41 | ///The URLSession for this client.
42 | open var session: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
43 |
44 | ///The queue used for asynchronous operations.
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:207:38: error: cannot find type 'URLRequest' in scope
205 | ///- parameter request: The request to perform.
206 | ///- returns: The data and response returned by the request.
207 | open func performRequest(_ request: URLRequest) throws -> (Data, HTTPURLResponse) {
| `- error: cannot find type 'URLRequest' in scope
208 | let req = request
209 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:207:67: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
205 | ///- parameter request: The request to perform.
206 | ///- returns: The data and response returned by the request.
207 | open func performRequest(_ request: URLRequest) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
208 | let req = request
209 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:240:48: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
238 | ///- parameter url: The URL to send the request to.
239 | ///- returns: The data and response returned by the request.
240 | open func get(_ url: String) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
241 | guard let nsUrl = URL(string: url) else {
242 | throw RequestError.invalidURL(url: url)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:256:74: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
254 | ///
255 | ///- returns: The data and response returned by the request.
256 | open func post(_ url: String, fields: [String:String]) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
257 | guard let nsUrl = URL(string: url) else {
258 | throw RequestError.invalidURL(url: url)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:305:38: error: cannot find type 'URLRequest' in scope
303 | ///- parameter request: The request to perform.
304 | ///- returns: The text returned by the request.
305 | open func performRequest(_ request: URLRequest) throws -> String {
| `- error: cannot find type 'URLRequest' in scope
306 | let (data, _) = try performRequest(request)
307 | guard let string = String(data: data, encoding: String.Encoding.utf8) else {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:397:13: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
395 | //MARK: - Task management
396 | internal class HTTPTask {
397 | var task: URLSessionTask
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
399 |
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/SwiftStack/APIClient.swift:398:27: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
396 | internal class HTTPTask {
397 | var task: URLSessionTask
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
399 |
400 | var request: URLRequest!
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:400:16: error: cannot find type 'URLRequest' in scope
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
399 |
400 | var request: URLRequest!
| `- error: cannot find type 'URLRequest' in scope
401 |
402 | var data: Data?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:403:17: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
401 |
402 | var data: Data?
403 | var response: HTTPURLResponse?
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:406:39: error: cannot find type 'URLRequest' in scope
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: cannot find type 'URLRequest' in scope
407 | self.task = task
408 | self.completion = completion
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:406:14: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
407 | self.task = task
408 | self.completion = completion
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/SwiftStack/APIClient.swift:406:82: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
407 | self.task = task
408 | self.completion = completion
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:418:61: error: cannot find type 'URLRequest' in scope
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: cannot find type 'URLRequest' in scope
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:418:36: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
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/SwiftStack/APIClient.swift:418:104: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:433:44: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
434 |
435 | guard let task = tasks[dataTask] else {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:430:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
428 | //MARK: - URLSession delegate methods
429 | public func urlSession(
430 | _ session: URLSession,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:431:13: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
429 | public func urlSession(
430 | _ session: URLSession,
431 | dataTask: URLSessionDataTask,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
432 | didReceive response: URLResponse,
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:432:24: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
430 | _ session: URLSession,
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
434 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:451:36: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
449 | }
450 |
451 | public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
452 | guard let task = tasks[dataTask] else {
453 | print("\(dataTask) is not in client task list; ignoring")
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:451:58: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
449 | }
450 |
451 | public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
452 | guard let task = tasks[dataTask] else {
453 | print("\(dataTask) is not in client task list; ignoring")
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:465:36: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
463 | }
464 |
465 | public func urlSession(_ session: URLSession, task sessionTask: URLSessionTask, didCompleteWithError error: Error?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
466 | guard let task = tasks[sessionTask] else {
467 | print("\(sessionTask) is not in client task list; ignoring")
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:465:66: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
463 | }
464 |
465 | public func urlSession(_ session: URLSession, task sessionTask: URLSessionTask, didCompleteWithError error: Error?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
466 | guard let task = tasks[sessionTask] else {
467 | print("\(sessionTask) is not in client task list; ignoring")
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/SwiftStack/APIClient.swift:482:23: error: cannot find type 'URLRequest' in scope
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
| `- error: cannot find type 'URLRequest' in scope
483 | completionHandler: @escaping (URLRequest?) -> Void
484 | ) {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:483:33: error: cannot find type 'URLRequest' in scope
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
483 | completionHandler: @escaping (URLRequest?) -> Void
| `- error: cannot find type 'URLRequest' in scope
484 | ) {
485 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:479:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
477 |
478 | public func urlSession(
479 | _ session: URLSession,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:480:9: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
478 | public func urlSession(
479 | _ session: URLSession,
480 | task: URLSessionTask,
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
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/SwiftStack/APIClient.swift:481:40: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
479 | _ session: URLSession,
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
482 | newRequest request: URLRequest,
483 | completionHandler: @escaping (URLRequest?) -> Void
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:38:33: error: cannot find type 'URLSessionDataDelegate' in scope
36 |
37 | ///An APIClient communicates to the Stack Exchange API over HTTP.
38 | open class APIClient: NSObject, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
39 | //MARK: Instance variables and types.
40 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:212:13: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 | let sema = DispatchSemaphore(value: 0)
211 | var data: Data!
212 | var resp: URLResponse!
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
213 | var error: Error!
214 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:219:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
217 | //TODO: I don't think this needs to be on the client queue anymore
218 | queue.async {
219 | let task = self.session.dataTask(with: req)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
220 | self.performTask(task, request: req) {inData, inResp, inError in
221 | (data, resp, error) = (inData, inResp, inError)
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:229:29: warning: conditional downcast from 'URLResponse?' (aka 'Optional<AnyObject>') to 'HTTPURLResponse' (aka 'AnyObject') does nothing
227 | sema.wait()
228 |
229 | guard let response = resp as? HTTPURLResponse, data != nil else {
| `- warning: conditional downcast from 'URLResponse?' (aka 'Optional<AnyObject>') to 'HTTPURLResponse' (aka 'AnyObject') does nothing
230 | throw error
231 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:229:33: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
227 | sema.wait()
228 |
229 | guard let response = resp as? HTTPURLResponse, data != nil else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
230 | throw error
231 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:244:17: error: cannot find 'URLRequest' in scope
242 | throw RequestError.invalidURL(url: url)
243 | }
244 | var request = URLRequest(url: nsUrl)
| `- error: cannot find 'URLRequest' in scope
245 | request.setValue(String(request.httpBody?.count ?? 0), forHTTPHeaderField: "Content-Length")
246 | return try performRequest(request)
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:263:17: error: cannot find 'URLRequest' in scope
261 | throw RequestError.notUTF8
262 | }
263 | var request = URLRequest(url: nsUrl)
| `- error: cannot find 'URLRequest' in scope
264 | request.httpMethod = "POST"
265 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:271:13: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
269 |
270 | var responseData: Data?
271 | var resp: HTTPURLResponse?
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
272 | var responseError: Error?
273 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:275:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'uploadTask'
273 |
274 | queue.async {
275 | let task = self.session.uploadTask(with: request, from: data)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'uploadTask'
276 | self.performTask(task, request: request) {data, response, error in
277 | (responseData, resp, responseError) = (data, response, error)
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:360:48: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
358 | super.init()
359 |
360 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
361 |
362 | if proxyAddress != nil {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:368:6: error: cannot find 'kCFNetworkProxiesHTTPProxy' in scope
366 | configuration.connectionProxyDictionary = [
367 | "HTTPEnable" : 1,
368 | kCFNetworkProxiesHTTPProxy as AnyHashable : proxyAddress!,
| `- error: cannot find 'kCFNetworkProxiesHTTPProxy' in scope
369 | kCFNetworkProxiesHTTPPort as AnyHashable : proxyPort,
370 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:369:6: error: cannot find 'kCFNetworkProxiesHTTPPort' in scope
367 | "HTTPEnable" : 1,
368 | kCFNetworkProxiesHTTPProxy as AnyHashable : proxyAddress!,
369 | kCFNetworkProxiesHTTPPort as AnyHashable : proxyPort,
| `- error: cannot find 'kCFNetworkProxiesHTTPPort' in scope
370 |
371 | "HTTPSEnable" : 1,
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:372:6: error: cannot find 'kCFNetworkProxiesHTTPSProxy' in scope
370 |
371 | "HTTPSEnable" : 1,
372 | kCFNetworkProxiesHTTPSProxy as AnyHashable : proxyAddress!,
| `- error: cannot find 'kCFNetworkProxiesHTTPSProxy' in scope
373 | kCFNetworkProxiesHTTPSPort as AnyHashable : proxyPort
374 | ]
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:373:6: error: cannot find 'kCFNetworkProxiesHTTPSPort' in scope
371 | "HTTPSEnable" : 1,
372 | kCFNetworkProxiesHTTPSProxy as AnyHashable : proxyAddress!,
373 | kCFNetworkProxiesHTTPSPort as AnyHashable : proxyPort
| `- error: cannot find 'kCFNetworkProxiesHTTPSPort' in scope
374 | ]
375 | #endif
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:384:13: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
382 | delegateQueue.maxConcurrentOperationCount = 1
383 |
384 | session = URLSession(
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
385 | configuration: configuration,
386 | delegate: self, delegateQueue: delegateQueue
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:420:8: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'resume'
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'resume'
421 | }
422 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:437:23: error: cannot infer contextual base in reference to member 'cancel'
435 | guard let task = tasks[dataTask] else {
436 | print("\(dataTask) is not in client task list; cancelling")
437 | completionHandler(.cancel)
| `- error: cannot infer contextual base in reference to member 'cancel'
438 | return
439 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:442:49: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
440 |
441 | var headers = [String:String]()
442 | for (k, v) in (response as? HTTPURLResponse)?.allHeaderFields ?? [:] {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
443 | headers[String(describing: k)] = String(describing: v)
444 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:442:65: error: pattern cannot match values of type '(key: AnyHashable, value: Any)'
440 |
441 | var headers = [String:String]()
442 | for (k, v) in (response as? HTTPURLResponse)?.allHeaderFields ?? [:] {
| `- error: pattern cannot match values of type '(key: AnyHashable, value: Any)'
443 | headers[String(describing: k)] = String(describing: v)
444 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:447:28: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
445 |
446 |
447 | task.response = response as? HTTPURLResponse
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
448 | completionHandler(.allow)
449 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:448:22: error: cannot infer contextual base in reference to member 'allow'
446 |
447 | task.response = response as? HTTPURLResponse
448 | completionHandler(.allow)
| `- error: cannot infer contextual base in reference to member 'allow'
449 | }
450 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:487:26: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
485 |
486 | var headers = [String:String]()
487 | for (k, v) in response.allHeaderFields {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
488 | headers[String(describing: k)] = String(describing: v)
489 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:497:11: error: value of type 'URLSession' (aka 'AnyObject') has no member 'invalidateAndCancel'
495 |
496 | deinit {
497 | session.invalidateAndCancel()
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'invalidateAndCancel'
498 | }
499 | }
[5/27] Compiling SwiftStack APIResponse.swift
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:42:20: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
40 |
41 | ///The URLSession for this client.
42 | open var session: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
43 |
44 | ///The queue used for asynchronous operations.
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:207:38: error: cannot find type 'URLRequest' in scope
205 | ///- parameter request: The request to perform.
206 | ///- returns: The data and response returned by the request.
207 | open func performRequest(_ request: URLRequest) throws -> (Data, HTTPURLResponse) {
| `- error: cannot find type 'URLRequest' in scope
208 | let req = request
209 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:207:67: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
205 | ///- parameter request: The request to perform.
206 | ///- returns: The data and response returned by the request.
207 | open func performRequest(_ request: URLRequest) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
208 | let req = request
209 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:240:48: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
238 | ///- parameter url: The URL to send the request to.
239 | ///- returns: The data and response returned by the request.
240 | open func get(_ url: String) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
241 | guard let nsUrl = URL(string: url) else {
242 | throw RequestError.invalidURL(url: url)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:256:74: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
254 | ///
255 | ///- returns: The data and response returned by the request.
256 | open func post(_ url: String, fields: [String:String]) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
257 | guard let nsUrl = URL(string: url) else {
258 | throw RequestError.invalidURL(url: url)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:305:38: error: cannot find type 'URLRequest' in scope
303 | ///- parameter request: The request to perform.
304 | ///- returns: The text returned by the request.
305 | open func performRequest(_ request: URLRequest) throws -> String {
| `- error: cannot find type 'URLRequest' in scope
306 | let (data, _) = try performRequest(request)
307 | guard let string = String(data: data, encoding: String.Encoding.utf8) else {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:397:13: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
395 | //MARK: - Task management
396 | internal class HTTPTask {
397 | var task: URLSessionTask
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
399 |
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/SwiftStack/APIClient.swift:398:27: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
396 | internal class HTTPTask {
397 | var task: URLSessionTask
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
399 |
400 | var request: URLRequest!
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:400:16: error: cannot find type 'URLRequest' in scope
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
399 |
400 | var request: URLRequest!
| `- error: cannot find type 'URLRequest' in scope
401 |
402 | var data: Data?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:403:17: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
401 |
402 | var data: Data?
403 | var response: HTTPURLResponse?
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:406:39: error: cannot find type 'URLRequest' in scope
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: cannot find type 'URLRequest' in scope
407 | self.task = task
408 | self.completion = completion
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:406:14: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
407 | self.task = task
408 | self.completion = completion
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/SwiftStack/APIClient.swift:406:82: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
407 | self.task = task
408 | self.completion = completion
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:418:61: error: cannot find type 'URLRequest' in scope
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: cannot find type 'URLRequest' in scope
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:418:36: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
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/SwiftStack/APIClient.swift:418:104: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:433:44: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
434 |
435 | guard let task = tasks[dataTask] else {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:430:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
428 | //MARK: - URLSession delegate methods
429 | public func urlSession(
430 | _ session: URLSession,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:431:13: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
429 | public func urlSession(
430 | _ session: URLSession,
431 | dataTask: URLSessionDataTask,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
432 | didReceive response: URLResponse,
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:432:24: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
430 | _ session: URLSession,
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
434 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:451:36: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
449 | }
450 |
451 | public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
452 | guard let task = tasks[dataTask] else {
453 | print("\(dataTask) is not in client task list; ignoring")
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:451:58: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
449 | }
450 |
451 | public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
452 | guard let task = tasks[dataTask] else {
453 | print("\(dataTask) is not in client task list; ignoring")
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:465:36: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
463 | }
464 |
465 | public func urlSession(_ session: URLSession, task sessionTask: URLSessionTask, didCompleteWithError error: Error?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
466 | guard let task = tasks[sessionTask] else {
467 | print("\(sessionTask) is not in client task list; ignoring")
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:465:66: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
463 | }
464 |
465 | public func urlSession(_ session: URLSession, task sessionTask: URLSessionTask, didCompleteWithError error: Error?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
466 | guard let task = tasks[sessionTask] else {
467 | print("\(sessionTask) is not in client task list; ignoring")
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/SwiftStack/APIClient.swift:482:23: error: cannot find type 'URLRequest' in scope
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
| `- error: cannot find type 'URLRequest' in scope
483 | completionHandler: @escaping (URLRequest?) -> Void
484 | ) {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:483:33: error: cannot find type 'URLRequest' in scope
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
483 | completionHandler: @escaping (URLRequest?) -> Void
| `- error: cannot find type 'URLRequest' in scope
484 | ) {
485 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:479:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
477 |
478 | public func urlSession(
479 | _ session: URLSession,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:480:9: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
478 | public func urlSession(
479 | _ session: URLSession,
480 | task: URLSessionTask,
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
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/SwiftStack/APIClient.swift:481:40: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
479 | _ session: URLSession,
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
482 | newRequest request: URLRequest,
483 | completionHandler: @escaping (URLRequest?) -> Void
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:38:33: error: cannot find type 'URLSessionDataDelegate' in scope
36 |
37 | ///An APIClient communicates to the Stack Exchange API over HTTP.
38 | open class APIClient: NSObject, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
39 | //MARK: Instance variables and types.
40 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:212:13: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 | let sema = DispatchSemaphore(value: 0)
211 | var data: Data!
212 | var resp: URLResponse!
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
213 | var error: Error!
214 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:219:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
217 | //TODO: I don't think this needs to be on the client queue anymore
218 | queue.async {
219 | let task = self.session.dataTask(with: req)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
220 | self.performTask(task, request: req) {inData, inResp, inError in
221 | (data, resp, error) = (inData, inResp, inError)
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:229:29: warning: conditional downcast from 'URLResponse?' (aka 'Optional<AnyObject>') to 'HTTPURLResponse' (aka 'AnyObject') does nothing
227 | sema.wait()
228 |
229 | guard let response = resp as? HTTPURLResponse, data != nil else {
| `- warning: conditional downcast from 'URLResponse?' (aka 'Optional<AnyObject>') to 'HTTPURLResponse' (aka 'AnyObject') does nothing
230 | throw error
231 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:229:33: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
227 | sema.wait()
228 |
229 | guard let response = resp as? HTTPURLResponse, data != nil else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
230 | throw error
231 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:244:17: error: cannot find 'URLRequest' in scope
242 | throw RequestError.invalidURL(url: url)
243 | }
244 | var request = URLRequest(url: nsUrl)
| `- error: cannot find 'URLRequest' in scope
245 | request.setValue(String(request.httpBody?.count ?? 0), forHTTPHeaderField: "Content-Length")
246 | return try performRequest(request)
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:263:17: error: cannot find 'URLRequest' in scope
261 | throw RequestError.notUTF8
262 | }
263 | var request = URLRequest(url: nsUrl)
| `- error: cannot find 'URLRequest' in scope
264 | request.httpMethod = "POST"
265 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:271:13: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
269 |
270 | var responseData: Data?
271 | var resp: HTTPURLResponse?
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
272 | var responseError: Error?
273 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:275:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'uploadTask'
273 |
274 | queue.async {
275 | let task = self.session.uploadTask(with: request, from: data)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'uploadTask'
276 | self.performTask(task, request: request) {data, response, error in
277 | (responseData, resp, responseError) = (data, response, error)
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:360:48: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
358 | super.init()
359 |
360 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
361 |
362 | if proxyAddress != nil {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:368:6: error: cannot find 'kCFNetworkProxiesHTTPProxy' in scope
366 | configuration.connectionProxyDictionary = [
367 | "HTTPEnable" : 1,
368 | kCFNetworkProxiesHTTPProxy as AnyHashable : proxyAddress!,
| `- error: cannot find 'kCFNetworkProxiesHTTPProxy' in scope
369 | kCFNetworkProxiesHTTPPort as AnyHashable : proxyPort,
370 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:369:6: error: cannot find 'kCFNetworkProxiesHTTPPort' in scope
367 | "HTTPEnable" : 1,
368 | kCFNetworkProxiesHTTPProxy as AnyHashable : proxyAddress!,
369 | kCFNetworkProxiesHTTPPort as AnyHashable : proxyPort,
| `- error: cannot find 'kCFNetworkProxiesHTTPPort' in scope
370 |
371 | "HTTPSEnable" : 1,
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:372:6: error: cannot find 'kCFNetworkProxiesHTTPSProxy' in scope
370 |
371 | "HTTPSEnable" : 1,
372 | kCFNetworkProxiesHTTPSProxy as AnyHashable : proxyAddress!,
| `- error: cannot find 'kCFNetworkProxiesHTTPSProxy' in scope
373 | kCFNetworkProxiesHTTPSPort as AnyHashable : proxyPort
374 | ]
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:373:6: error: cannot find 'kCFNetworkProxiesHTTPSPort' in scope
371 | "HTTPSEnable" : 1,
372 | kCFNetworkProxiesHTTPSProxy as AnyHashable : proxyAddress!,
373 | kCFNetworkProxiesHTTPSPort as AnyHashable : proxyPort
| `- error: cannot find 'kCFNetworkProxiesHTTPSPort' in scope
374 | ]
375 | #endif
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:384:13: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
382 | delegateQueue.maxConcurrentOperationCount = 1
383 |
384 | session = URLSession(
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
385 | configuration: configuration,
386 | delegate: self, delegateQueue: delegateQueue
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:420:8: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'resume'
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'resume'
421 | }
422 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:437:23: error: cannot infer contextual base in reference to member 'cancel'
435 | guard let task = tasks[dataTask] else {
436 | print("\(dataTask) is not in client task list; cancelling")
437 | completionHandler(.cancel)
| `- error: cannot infer contextual base in reference to member 'cancel'
438 | return
439 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:442:49: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
440 |
441 | var headers = [String:String]()
442 | for (k, v) in (response as? HTTPURLResponse)?.allHeaderFields ?? [:] {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
443 | headers[String(describing: k)] = String(describing: v)
444 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:442:65: error: pattern cannot match values of type '(key: AnyHashable, value: Any)'
440 |
441 | var headers = [String:String]()
442 | for (k, v) in (response as? HTTPURLResponse)?.allHeaderFields ?? [:] {
| `- error: pattern cannot match values of type '(key: AnyHashable, value: Any)'
443 | headers[String(describing: k)] = String(describing: v)
444 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:447:28: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
445 |
446 |
447 | task.response = response as? HTTPURLResponse
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
448 | completionHandler(.allow)
449 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:448:22: error: cannot infer contextual base in reference to member 'allow'
446 |
447 | task.response = response as? HTTPURLResponse
448 | completionHandler(.allow)
| `- error: cannot infer contextual base in reference to member 'allow'
449 | }
450 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:487:26: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
485 |
486 | var headers = [String:String]()
487 | for (k, v) in response.allHeaderFields {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
488 | headers[String(describing: k)] = String(describing: v)
489 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:497:11: error: value of type 'URLSession' (aka 'AnyObject') has no member 'invalidateAndCancel'
495 |
496 | deinit {
497 | session.invalidateAndCancel()
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'invalidateAndCancel'
498 | }
499 | }
[6/27] Compiling SwiftStack Answer.swift
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:42:20: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
40 |
41 | ///The URLSession for this client.
42 | open var session: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
43 |
44 | ///The queue used for asynchronous operations.
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:207:38: error: cannot find type 'URLRequest' in scope
205 | ///- parameter request: The request to perform.
206 | ///- returns: The data and response returned by the request.
207 | open func performRequest(_ request: URLRequest) throws -> (Data, HTTPURLResponse) {
| `- error: cannot find type 'URLRequest' in scope
208 | let req = request
209 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:207:67: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
205 | ///- parameter request: The request to perform.
206 | ///- returns: The data and response returned by the request.
207 | open func performRequest(_ request: URLRequest) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
208 | let req = request
209 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:240:48: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
238 | ///- parameter url: The URL to send the request to.
239 | ///- returns: The data and response returned by the request.
240 | open func get(_ url: String) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
241 | guard let nsUrl = URL(string: url) else {
242 | throw RequestError.invalidURL(url: url)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:256:74: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
254 | ///
255 | ///- returns: The data and response returned by the request.
256 | open func post(_ url: String, fields: [String:String]) throws -> (Data, HTTPURLResponse) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
257 | guard let nsUrl = URL(string: url) else {
258 | throw RequestError.invalidURL(url: url)
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:305:38: error: cannot find type 'URLRequest' in scope
303 | ///- parameter request: The request to perform.
304 | ///- returns: The text returned by the request.
305 | open func performRequest(_ request: URLRequest) throws -> String {
| `- error: cannot find type 'URLRequest' in scope
306 | let (data, _) = try performRequest(request)
307 | guard let string = String(data: data, encoding: String.Encoding.utf8) else {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:397:13: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
395 | //MARK: - Task management
396 | internal class HTTPTask {
397 | var task: URLSessionTask
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
399 |
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/SwiftStack/APIClient.swift:398:27: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
396 | internal class HTTPTask {
397 | var task: URLSessionTask
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
399 |
400 | var request: URLRequest!
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:400:16: error: cannot find type 'URLRequest' in scope
398 | var completion: (Data?, HTTPURLResponse?, Error?) -> Void
399 |
400 | var request: URLRequest!
| `- error: cannot find type 'URLRequest' in scope
401 |
402 | var data: Data?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:403:17: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
401 |
402 | var data: Data?
403 | var response: HTTPURLResponse?
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:406:39: error: cannot find type 'URLRequest' in scope
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: cannot find type 'URLRequest' in scope
407 | self.task = task
408 | self.completion = completion
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:406:14: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
407 | self.task = task
408 | self.completion = completion
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/SwiftStack/APIClient.swift:406:82: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
404 | var error: Error?
405 |
406 | init(task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
407 | self.task = task
408 | self.completion = completion
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:418:61: error: cannot find type 'URLRequest' in scope
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: cannot find type 'URLRequest' in scope
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:418:36: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
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/SwiftStack/APIClient.swift:418:104: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
416 |
417 |
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:433:44: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
434 |
435 | guard let task = tasks[dataTask] else {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:430:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
428 | //MARK: - URLSession delegate methods
429 | public func urlSession(
430 | _ session: URLSession,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:431:13: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
429 | public func urlSession(
430 | _ session: URLSession,
431 | dataTask: URLSessionDataTask,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
432 | didReceive response: URLResponse,
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:432:24: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
430 | _ session: URLSession,
431 | dataTask: URLSessionDataTask,
432 | didReceive response: URLResponse,
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
433 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
434 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:451:36: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
449 | }
450 |
451 | public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
452 | guard let task = tasks[dataTask] else {
453 | print("\(dataTask) is not in client task list; ignoring")
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:451:58: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
449 | }
450 |
451 | public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
452 | guard let task = tasks[dataTask] else {
453 | print("\(dataTask) is not in client task list; ignoring")
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' 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 URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:465:36: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
463 | }
464 |
465 | public func urlSession(_ session: URLSession, task sessionTask: URLSessionTask, didCompleteWithError error: Error?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
466 | guard let task = tasks[sessionTask] else {
467 | print("\(sessionTask) is not in client task list; ignoring")
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:465:66: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
463 | }
464 |
465 | public func urlSession(_ session: URLSession, task sessionTask: URLSessionTask, didCompleteWithError error: Error?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
466 | guard let task = tasks[sessionTask] else {
467 | print("\(sessionTask) is not in client task list; ignoring")
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/SwiftStack/APIClient.swift:482:23: error: cannot find type 'URLRequest' in scope
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
| `- error: cannot find type 'URLRequest' in scope
483 | completionHandler: @escaping (URLRequest?) -> Void
484 | ) {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:483:33: error: cannot find type 'URLRequest' in scope
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
483 | completionHandler: @escaping (URLRequest?) -> Void
| `- error: cannot find type 'URLRequest' in scope
484 | ) {
485 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:479:14: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
477 |
478 | public func urlSession(
479 | _ session: URLSession,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
Foundation.URLSession:2:18: note: 'URLSession' 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 URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:480:9: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
478 | public func urlSession(
479 | _ session: URLSession,
480 | task: URLSessionTask,
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
481 | willPerformHTTPRedirection response: HTTPURLResponse,
482 | newRequest request: URLRequest,
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/SwiftStack/APIClient.swift:481:40: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
479 | _ session: URLSession,
480 | task: URLSessionTask,
481 | willPerformHTTPRedirection response: HTTPURLResponse,
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
482 | newRequest request: URLRequest,
483 | completionHandler: @escaping (URLRequest?) -> Void
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:38:33: error: cannot find type 'URLSessionDataDelegate' in scope
36 |
37 | ///An APIClient communicates to the Stack Exchange API over HTTP.
38 | open class APIClient: NSObject, URLSessionDataDelegate {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
39 | //MARK: Instance variables and types.
40 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:212:13: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 | let sema = DispatchSemaphore(value: 0)
211 | var data: Data!
212 | var resp: URLResponse!
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
213 | var error: Error!
214 |
Foundation.URLResponse:2:18: note: 'URLResponse' 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 URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:219:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
217 | //TODO: I don't think this needs to be on the client queue anymore
218 | queue.async {
219 | let task = self.session.dataTask(with: req)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
220 | self.performTask(task, request: req) {inData, inResp, inError in
221 | (data, resp, error) = (inData, inResp, inError)
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:229:29: warning: conditional downcast from 'URLResponse?' (aka 'Optional<AnyObject>') to 'HTTPURLResponse' (aka 'AnyObject') does nothing
227 | sema.wait()
228 |
229 | guard let response = resp as? HTTPURLResponse, data != nil else {
| `- warning: conditional downcast from 'URLResponse?' (aka 'Optional<AnyObject>') to 'HTTPURLResponse' (aka 'AnyObject') does nothing
230 | throw error
231 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:229:33: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
227 | sema.wait()
228 |
229 | guard let response = resp as? HTTPURLResponse, data != nil else {
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
230 | throw error
231 | }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:244:17: error: cannot find 'URLRequest' in scope
242 | throw RequestError.invalidURL(url: url)
243 | }
244 | var request = URLRequest(url: nsUrl)
| `- error: cannot find 'URLRequest' in scope
245 | request.setValue(String(request.httpBody?.count ?? 0), forHTTPHeaderField: "Content-Length")
246 | return try performRequest(request)
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:263:17: error: cannot find 'URLRequest' in scope
261 | throw RequestError.notUTF8
262 | }
263 | var request = URLRequest(url: nsUrl)
| `- error: cannot find 'URLRequest' in scope
264 | request.httpMethod = "POST"
265 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:271:13: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
269 |
270 | var responseData: Data?
271 | var resp: HTTPURLResponse?
| `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
272 | var responseError: Error?
273 |
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' 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 HTTPURLResponse = AnyObject
| `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:275:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'uploadTask'
273 |
274 | queue.async {
275 | let task = self.session.uploadTask(with: request, from: data)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'uploadTask'
276 | self.performTask(task, request: request) {data, response, error in
277 | (responseData, resp, responseError) = (data, response, error)
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:360:48: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
358 | super.init()
359 |
360 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
361 |
362 | if proxyAddress != nil {
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:368:6: error: cannot find 'kCFNetworkProxiesHTTPProxy' in scope
366 | configuration.connectionProxyDictionary = [
367 | "HTTPEnable" : 1,
368 | kCFNetworkProxiesHTTPProxy as AnyHashable : proxyAddress!,
| `- error: cannot find 'kCFNetworkProxiesHTTPProxy' in scope
369 | kCFNetworkProxiesHTTPPort as AnyHashable : proxyPort,
370 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:369:6: error: cannot find 'kCFNetworkProxiesHTTPPort' in scope
367 | "HTTPEnable" : 1,
368 | kCFNetworkProxiesHTTPProxy as AnyHashable : proxyAddress!,
369 | kCFNetworkProxiesHTTPPort as AnyHashable : proxyPort,
| `- error: cannot find 'kCFNetworkProxiesHTTPPort' in scope
370 |
371 | "HTTPSEnable" : 1,
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:372:6: error: cannot find 'kCFNetworkProxiesHTTPSProxy' in scope
370 |
371 | "HTTPSEnable" : 1,
372 | kCFNetworkProxiesHTTPSProxy as AnyHashable : proxyAddress!,
| `- error: cannot find 'kCFNetworkProxiesHTTPSProxy' in scope
373 | kCFNetworkProxiesHTTPSPort as AnyHashable : proxyPort
374 | ]
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:373:6: error: cannot find 'kCFNetworkProxiesHTTPSPort' in scope
371 | "HTTPSEnable" : 1,
372 | kCFNetworkProxiesHTTPSProxy as AnyHashable : proxyAddress!,
373 | kCFNetworkProxiesHTTPSPort as AnyHashable : proxyPort
| `- error: cannot find 'kCFNetworkProxiesHTTPSPort' in scope
374 | ]
375 | #endif
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:384:13: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
382 | delegateQueue.maxConcurrentOperationCount = 1
383 |
384 | session = URLSession(
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
385 | configuration: configuration,
386 | delegate: self, delegateQueue: delegateQueue
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:420:8: error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'resume'
418 | internal func performTask(_ task: URLSessionTask, request: URLRequest!, completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) {
419 | tasks[task] = HTTPTask(task: task, request: request, completion: completion)
420 | task.resume()
| `- error: value of type 'URLSessionTask' (aka 'AnyObject') has no member 'resume'
421 | }
422 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:437:23: error: cannot infer contextual base in reference to member 'cancel'
435 | guard let task = tasks[dataTask] else {
436 | print("\(dataTask) is not in client task list; cancelling")
437 | completionHandler(.cancel)
| `- error: cannot infer contextual base in reference to member 'cancel'
438 | return
439 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:442:49: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
440 |
441 | var headers = [String:String]()
442 | for (k, v) in (response as? HTTPURLResponse)?.allHeaderFields ?? [:] {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
443 | headers[String(describing: k)] = String(describing: v)
444 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:442:65: error: pattern cannot match values of type '(key: AnyHashable, value: Any)'
440 |
441 | var headers = [String:String]()
442 | for (k, v) in (response as? HTTPURLResponse)?.allHeaderFields ?? [:] {
| `- error: pattern cannot match values of type '(key: AnyHashable, value: Any)'
443 | headers[String(describing: k)] = String(describing: v)
444 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:447:28: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
445 |
446 |
447 | task.response = response as? HTTPURLResponse
| `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
448 | completionHandler(.allow)
449 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:448:22: error: cannot infer contextual base in reference to member 'allow'
446 |
447 | task.response = response as? HTTPURLResponse
448 | completionHandler(.allow)
| `- error: cannot infer contextual base in reference to member 'allow'
449 | }
450 |
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:487:26: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
485 |
486 | var headers = [String:String]()
487 | for (k, v) in response.allHeaderFields {
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'allHeaderFields'
488 | headers[String(describing: k)] = String(describing: v)
489 | }
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:497:11: error: value of type 'URLSession' (aka 'AnyObject') has no member 'invalidateAndCancel'
495 |
496 | deinit {
497 | session.invalidateAndCancel()
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'invalidateAndCancel'
498 | }
499 | }
[7/27] Compiling SwiftStack Revision.swift
[8/27] Compiling SwiftStack Site.swift
[9/27] Compiling SwiftStack String+HTMLEntities.swift
[10/27] Compiling SwiftStack RequestsRevisions.swift
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
[11/27] Compiling SwiftStack RequestsSites.swift
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
[12/27] Compiling SwiftStack RequestsSuggestedEdits.swift
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
[13/27] Compiling SwiftStack Post.swift
[14/27] Compiling SwiftStack Privilege.swift
[15/27] Compiling SwiftStack Question.swift
[16/27] Compiling SwiftStack BadgeCount.swift
[17/27] Compiling SwiftStack Comment.swift
[18/27] Compiling SwiftStack Content.swift
[19/27] Compiling SwiftStack RequestsAnswers.swift
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
[20/27] Compiling SwiftStack RequestsPrivileges.swift
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
[21/27] Compiling SwiftStack RequestsQuestions.swift
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: type 'URLSessionTask' (aka 'AnyObject') does not conform to protocol 'Hashable'
414 |
415 | private var responseSemaphore: DispatchSemaphore?
/host/spi-builder-workspace/Sources/SwiftStack/APIClient.swift:413:23: error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
411 | }
412 |
413 | internal var tasks = [URLSessionTask:HTTPTask]()
| `- error: 'URLSessionTask' (aka 'AnyObject') cannot be used as a type conforming to protocol 'Hashable' because 'Hashable' has static requirements
414 |
415 | private var responseSemaphore: DispatchSemaphore?
[22/27] Compiling SwiftStack DictionaryConvertible.swift
[23/27] Compiling SwiftStack JsonConvertible.swift
[24/27] Compiling SwiftStack JsonHelper.swift
[25/27] Compiling SwiftStack StringRepresentable.swift
[26/27] Compiling SwiftStack SuggestedEdit.swift
[27/27] Compiling SwiftStack User.swift
BUILD FAILURE 6.2 android