{"action":"created","issue":{"url":"https://api.github.com/repos/flow-typed/flow-typed/issues/2720","repository_url":"https://api.github.com/repos/flow-typed/flow-typed","labels_url":"https://api.github.com/repos/flow-typed/flow-typed/issues/2720/labels{/name}","comments_url":"https://api.github.com/repos/flow-typed/flow-typed/issues/2720/comments","events_url":"https://api.github.com/repos/flow-typed/flow-typed/issues/2720/events","html_url":"https://github.com/flow-typed/flow-typed/pull/2720","id":358894839,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0NTE4MTgy","number":2720,"title":"lodash 'last' must return maybe - empty arrays return undefined","user":{"login":"deecewan","id":4755785,"node_id":"MDQ6VXNlcjQ3NTU3ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/4755785?v=4","gravatar_id":"","url":"https://api.github.com/users/deecewan","html_url":"https://github.com/deecewan","followers_url":"https://api.github.com/users/deecewan/followers","following_url":"https://api.github.com/users/deecewan/following{/other_user}","gists_url":"https://api.github.com/users/deecewan/gists{/gist_id}","starred_url":"https://api.github.com/users/deecewan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deecewan/subscriptions","organizations_url":"https://api.github.com/users/deecewan/orgs","repos_url":"https://api.github.com/users/deecewan/repos","events_url":"https://api.github.com/users/deecewan/events{/privacy}","received_events_url":"https://api.github.com/users/deecewan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-11T05:45:27Z","updated_at":"2018-09-15T09:16:39Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/flow-typed/flow-typed/pulls/2720","html_url":"https://github.com/flow-typed/flow-typed/pull/2720","diff_url":"https://github.com/flow-typed/flow-typed/pull/2720.diff","patch_url":"https://github.com/flow-typed/flow-typed/pull/2720.patch"},"body":"Currently, calling `_.last` returns `T`, where the argument is `Array<T>`. The return in that case will actually be `void` - the [lodash source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L7609) explicitly makes that the case.\r\n\r\nPreviously false negative:\r\n\r\n```js\r\nconst arr: Array<number> = [];\r\nconst res = _.last(arr);\r\n(res: number); // passes\r\n```"},"comment":{"url":"https://api.github.com/repos/flow-typed/flow-typed/issues/comments/421543457","html_url":"https://github.com/flow-typed/flow-typed/pull/2720#issuecomment-421543457","issue_url":"https://api.github.com/repos/flow-typed/flow-typed/issues/2720","id":421543457,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTU0MzQ1Nw==","user":{"login":"davidgomes","id":741621,"node_id":"MDQ6VXNlcjc0MTYyMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/741621?v=4","gravatar_id":"","url":"https://api.github.com/users/davidgomes","html_url":"https://github.com/davidgomes","followers_url":"https://api.github.com/users/davidgomes/followers","following_url":"https://api.github.com/users/davidgomes/following{/other_user}","gists_url":"https://api.github.com/users/davidgomes/gists{/gist_id}","starred_url":"https://api.github.com/users/davidgomes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidgomes/subscriptions","organizations_url":"https://api.github.com/users/davidgomes/orgs","repos_url":"https://api.github.com/users/davidgomes/repos","events_url":"https://api.github.com/users/davidgomes/events{/privacy}","received_events_url":"https://api.github.com/users/davidgomes/received_events","type":"User","site_admin":false},"created_at":"2018-09-15T09:16:39Z","updated_at":"2018-09-15T09:16:39Z","author_association":"CONTRIBUTOR","body":"I disagree with this change. First of all, it's inconsistent with the array index access operator `[i]` (which returns `T`). Secondly, it forces a `undefined` check when people are 100% sure that the element will exist (it's not that rare in my opinion) which is a potential performance issue (alternatively, people can use `$ExpectError` which is annoying).\r\n\r\nAs a side note, this is typed as `null | undefined | T` I believe, and `_.last` returns `undefined | T`."}}
{"actor":{"display_login":"davidgomes"}}