This code is in a test file, testing our main application. We installed the latest AFNetworking via Cocoapods into both our application and test targets. During compilation with Swift 4 we received the following abort trap.
@import AFNetworking
@testable import OurApp
//.. test class with various tests
// This is a mock object we use.
class UTSessionManager: AFHTTPSessionManager {
var lastRequestedUrlString: String?
override func dataTask(with request: URLRequest, completionHandler: ((URLResponse, Any?, Error?) -> Void)? = nil) -> URLSessionDataTask {
self.lastRequestedUrlString = request.url!.absoluteString
let url = URL(string: "/")!
let urlRequest = URLRequest(url: url)
return super.dataTask(with: urlRequest, completionHandler: completionHandler)
}
}
Environment
Swift 4 Xcode 9.0 iOS 11, iPhone 5SE simulatorAdditional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, CompilerCrash, Serialization | |Assignee | None | |Priority | Medium | md5: 83fb77e9961c9f87a4672d02e5890d80Issue Description:
This code is in a test file, testing our main application. We installed the latest AFNetworking via Cocoapods into both our application and test targets. During compilation with Swift 4 we received the following abort trap.