Created
February 28, 2017 10:45
-
-
Save pilky/c3248fc725e5e9db86ae270fd7d8a474 to your computer and use it in GitHub Desktop.
Swift compiler oddity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol URLSessionProtocol { | |
func dataTask(with url: URL, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol | |
} | |
protocol URLSessionDataTaskProtocol { | |
func resume() | |
} | |
extension URLSessionDataTask: URLSessionDataTaskProtocol {} | |
//Compiler complains of non conformance here | |
//Need to implement method and do casts to URLSessionDataTaskProtocol | |
extension URLSession: URLSessionProtocol {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment