{"action":"created","issue":{"url":"https://api.github.com/repos/mxcl/PromiseKit/issues/595","repository_url":"https://api.github.com/repos/mxcl/PromiseKit","labels_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/595/labels{/name}","comments_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/595/comments","events_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/595/events","html_url":"https://github.com/mxcl/PromiseKit/issues/595","id":192065952,"number":595,"title":"Adding @discardableResult to `then`","user":{"login":"FilipZawada","id":1159454,"avatar_url":"https://avatars.githubusercontent.com/u/1159454?v=3","gravatar_id":"","url":"https://api.github.com/users/FilipZawada","html_url":"https://github.com/FilipZawada","followers_url":"https://api.github.com/users/FilipZawada/followers","following_url":"https://api.github.com/users/FilipZawada/following{/other_user}","gists_url":"https://api.github.com/users/FilipZawada/gists{/gist_id}","starred_url":"https://api.github.com/users/FilipZawada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FilipZawada/subscriptions","organizations_url":"https://api.github.com/users/FilipZawada/orgs","repos_url":"https://api.github.com/users/FilipZawada/repos","events_url":"https://api.github.com/users/FilipZawada/events{/privacy}","received_events_url":"https://api.github.com/users/FilipZawada/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-28T17:24:45Z","updated_at":"2016-11-29T04:11:39Z","closed_at":null,"body":"I'd expect promises to return @discardableResult, to avoid compiler warning.\r\n\r\nRight now this:\r\n```\r\npromise.then {\r\n  ...\r\n}.then {\r\n  ...\r\n} \r\n```\r\n\r\nCauses compiler to warn about unused result. To prevent you have to do:\r\n\r\n```\r\n_ = promise.then {\r\n  ...\r\n}.then {\r\n  ...\r\n} \r\n```\r\n\r\n@mxcl What about me making a PR for this?"},"comment":{"url":"https://api.github.com/repos/mxcl/PromiseKit/issues/comments/263471373","html_url":"https://github.com/mxcl/PromiseKit/issues/595#issuecomment-263471373","issue_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/595","id":263471373,"user":{"login":"mxcl","id":58962,"avatar_url":"https://avatars.githubusercontent.com/u/58962?v=3","gravatar_id":"","url":"https://api.github.com/users/mxcl","html_url":"https://github.com/mxcl","followers_url":"https://api.github.com/users/mxcl/followers","following_url":"https://api.github.com/users/mxcl/following{/other_user}","gists_url":"https://api.github.com/users/mxcl/gists{/gist_id}","starred_url":"https://api.github.com/users/mxcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxcl/subscriptions","organizations_url":"https://api.github.com/users/mxcl/orgs","repos_url":"https://api.github.com/users/mxcl/repos","events_url":"https://api.github.com/users/mxcl/events{/privacy}","received_events_url":"https://api.github.com/users/mxcl/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T04:11:39Z","updated_at":"2016-11-29T04:11:39Z","body":"Also, during my use of PromiseKit, almost always I find that if I am getting this warning it means I am not handling errors. Only occasionally am I added a sub-chain where I know I am handling the error elsewhere and thus adding a `_ =` prefix is necessary and thus also a good indicator that I know the error is handled elsewhere.\r\n\r\nOther than the above mentioned cases where the promise cannot fail.\r\n\r\nAnother thing on this, this warning almost makes the `UnhandledErrorHandler` unnecessary, since the Swift compiler is ensuring we handle errors. We may want to consider deprecating it, unless I'm missing something."}}
{"actor":{"display_login":"mxcl"}}