{"action":"created","issue":{"url":"https://api.github.com/repos/Moya/Moya/issues/549","repository_url":"https://api.github.com/repos/Moya/Moya","labels_url":"https://api.github.com/repos/Moya/Moya/issues/549/labels{/name}","comments_url":"https://api.github.com/repos/Moya/Moya/issues/549/comments","events_url":"https://api.github.com/repos/Moya/Moya/issues/549/events","html_url":"https://github.com/Moya/Moya/issues/549","id":165660496,"number":549,"title":"Xcode error with new requestClosure in 7.0","user":{"login":"bryanbartow","id":867678,"avatar_url":"https://avatars.githubusercontent.com/u/867678?v=3","gravatar_id":"","url":"https://api.github.com/users/bryanbartow","html_url":"https://github.com/bryanbartow","followers_url":"https://api.github.com/users/bryanbartow/followers","following_url":"https://api.github.com/users/bryanbartow/following{/other_user}","gists_url":"https://api.github.com/users/bryanbartow/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanbartow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanbartow/subscriptions","organizations_url":"https://api.github.com/users/bryanbartow/orgs","repos_url":"https://api.github.com/users/bryanbartow/repos","events_url":"https://api.github.com/users/bryanbartow/events{/privacy}","received_events_url":"https://api.github.com/users/bryanbartow/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Moya/Moya/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-07-14T21:14:51Z","updated_at":"2016-07-25T16:03:02Z","closed_at":null,"body":"My request closure looks like this:\r\n```Swift\r\nlet requestClosure = { (endpoint: Moya.Endpoint<ICanHazProvider>, done: Result<NSURLRequest, Moya.Error> -> Void) in\r\n  let request = endpoint.urlRequest.mutableCopy() as! NSMutableURLRequest\r\n\r\n  if let token = self.getToken() {\r\n    request.setValue(token, forHTTPHeaderField: \"token\")\r\n  }\r\n\r\n  return done(.Success(request))\r\n}\r\n\r\nhazAPI = MoyaProvider<ICanHazProvider>(endpointClosure: endpointClosure, requestClosure: requestClosure)\r\n```\r\nI'm getting the following error in Xcode now:\r\n```\r\nUnable to infer closure return type in current context\r\n```\r\nIs there any secret to getting this to work?"},"comment":{"url":"https://api.github.com/repos/Moya/Moya/issues/comments/234998628","html_url":"https://github.com/Moya/Moya/issues/549#issuecomment-234998628","issue_url":"https://api.github.com/repos/Moya/Moya/issues/549","id":234998628,"user":{"login":"sunshinejr","id":5232779,"avatar_url":"https://avatars.githubusercontent.com/u/5232779?v=3","gravatar_id":"","url":"https://api.github.com/users/sunshinejr","html_url":"https://github.com/sunshinejr","followers_url":"https://api.github.com/users/sunshinejr/followers","following_url":"https://api.github.com/users/sunshinejr/following{/other_user}","gists_url":"https://api.github.com/users/sunshinejr/gists{/gist_id}","starred_url":"https://api.github.com/users/sunshinejr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunshinejr/subscriptions","organizations_url":"https://api.github.com/users/sunshinejr/orgs","repos_url":"https://api.github.com/users/sunshinejr/repos","events_url":"https://api.github.com/users/sunshinejr/events{/privacy}","received_events_url":"https://api.github.com/users/sunshinejr/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T16:03:02Z","updated_at":"2016-07-25T16:03:02Z","body":"@bryanbartow your problem might be returning the `Result` type in the closure that takes `Void` as a return type. Below code works under Xcode 7.3.1 & Moya 7.0.0:\r\n\r\n```swift\r\nlet requestClosure = { (endpoint: Moya.Endpoint< ICanHazProvider >, done: MoyaProvider.RequestResultClosure) in\r\n    let request = endpoint.urlRequest.mutableCopy() as! NSMutableURLRequest\r\n        \r\n    done(.Success(request))\r\n}\r\n```"}}
{"actor":{"display_login":"sunshinejr"}}