-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarerun-time crashBug → crash: Swift code crashed during executionBug → crash: Swift code crashed during execution
Description
| Previous ID | SR-7104 |
| Radar | None |
| Original Reporter | breiflabb (JIRA User) |
| Type | Bug |
| Status | Resolved |
| Resolution | Invalid |
Attachment: Download
Environment
Swift: 4.0.3
Target os: tvOS 11.2.6
Additional Detail from JIRA
| Votes | 0 |
| Component/s | |
| Labels | Bug, RunTimeCrash |
| Assignee | None |
| Priority | Medium |
md5: 83c5c391bc74a082aa143aad924d29fe
Issue Description:
Given a protocol 'A' which URLSessionDataTask and URLSessionDownloadTask conforms to.
protocol A {}
extension URLSessionDataTask: A{}
extension URLSessionDownloadTask: A {}App will crash if one passes results from getTasksWithCompletionHandler (DataTask, UploadTask, DownloadTask) to a completion handler which takes three parameters respectively (A, A, A). Like so:
func handleTasks(data: [A], upload: [A], download: [A]) {
}
URLSession.shared.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in
handleTasks(data: dataTasks, upload: uploadTasks, download: downloadTasks)
}The app will not crash if a single conformance for URLSessionTask is made.
extension URLSessionTask : A {}Attached 2 playgrounds to demonstrate.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarerun-time crashBug → crash: Swift code crashed during executionBug → crash: Swift code crashed during execution