koromiko / Tutorial

We are sample code :)
325 stars 240 forks source link

inifnite loop in protocol conformance #3

Closed ricardohg closed 5 years ago

ricardohg commented 6 years ago

Hello There, for some reason the protocol conformance method is calling itself instead of the default implementation here:

extension URLSession: URLSessionProtocol { func dataTask(with request: NSURLRequest, completionHandler: @escaping URLSessionProtocol.DataTaskResult) -> URLSessionDataTaskProtocol { return dataTask(with: request, completionHandler: completionHandler) } }

not sure what is wrong

Thanks, Ricardo.

koromiko commented 5 years ago

https://github.com/koromiko/Tutorial/commit/966277f7dad9585d5d25328443ac5c84762bcfd6

Hi this might fix the ambiguous reference to the self functions (the cause of the infinite loop)