{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/355","labels_url":"https://api.github.com/repos/facebook/flow/issues/355/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/355/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/355/events","html_url":"https://github.com/facebook/flow/issues/355","id":65317661,"number":355,"title":"types are tracked across index operator on arrays, but not unshift() function on arrays","user":{"login":"matthargett","id":1550766,"avatar_url":"https://avatars.githubusercontent.com/u/1550766?v=3","gravatar_id":"","url":"https://api.github.com/users/matthargett","html_url":"https://github.com/matthargett","followers_url":"https://api.github.com/users/matthargett/followers","following_url":"https://api.github.com/users/matthargett/following{/other_user}","gists_url":"https://api.github.com/users/matthargett/gists{/gist_id}","starred_url":"https://api.github.com/users/matthargett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthargett/subscriptions","organizations_url":"https://api.github.com/users/matthargett/orgs","repos_url":"https://api.github.com/users/matthargett/repos","events_url":"https://api.github.com/users/matthargett/events{/privacy}","received_events_url":"https://api.github.com/users/matthargett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-30T22:28:53Z","updated_at":"2015-04-11T17:09:36Z","closed_at":null,"body":"The incorrect property name is found in the first example below (thirdBug), but not the second example (fourthBug). These are simplified from a real-world bug in the Enyo sources that flow currently does not find.\r\nthirdbug.js:\r\nfunction normalizeHoldPulseConfig() {\r\n    return {events: [{hold: 'a'}]};\r\n}\r\n\r\nfunction thirdBug() {\r\n    // BAD/BUG reported correctly\r\n    console.log(normalizeHoldPulseConfig().events[0].name);\r\n}\r\n\r\nfourthbug.js:\r\nfunction normalizeHoldPulseConfig() {\r\n    return {events: [{hold: 'a'}]};\r\n}\r\n\r\nfunction fourthBug() {\r\n    var next_ = normalizeHoldPulseConfig();\r\n    // BAD/BUG\r\n    console.log(this.next_.events.unshift().name);\r\n}"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/91882184","html_url":"https://github.com/facebook/flow/issues/355#issuecomment-91882184","issue_url":"https://api.github.com/repos/facebook/flow/issues/355","id":91882184,"user":{"login":"popham","id":1271170,"avatar_url":"https://avatars.githubusercontent.com/u/1271170?v=3","gravatar_id":"","url":"https://api.github.com/users/popham","html_url":"https://github.com/popham","followers_url":"https://api.github.com/users/popham/followers","following_url":"https://api.github.com/users/popham/following{/other_user}","gists_url":"https://api.github.com/users/popham/gists{/gist_id}","starred_url":"https://api.github.com/users/popham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/popham/subscriptions","organizations_url":"https://api.github.com/users/popham/orgs","repos_url":"https://api.github.com/users/popham/repos","events_url":"https://api.github.com/users/popham/events{/privacy}","received_events_url":"https://api.github.com/users/popham/received_events","type":"User","site_admin":false},"created_at":"2015-04-11T17:09:36Z","updated_at":"2015-04-11T17:09:36Z","body":"Not bugs.\r\n\r\nFor `thirdBug`, see http://flowtype.org/docs/nullable-types.html#undefined-values.\r\n\r\nFor `fourthBug`, I think you meant to `shift`.  See the definition of Array in `lib/core.js`:\r\n\r\n```\r\ndeclare class Array<T> {\r\n  // ...\r\n  shift(): T;\r\n  // ...\r\n  unshift(...items: Array<T>): number;\r\n  // ...\r\n}\r\n```"}}