{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-compiler/issues/766","labels_url":"https://api.github.com/repos/google/closure-compiler/issues/766/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/766/comments","events_url":"https://api.github.com/repos/google/closure-compiler/issues/766/events","html_url":"https://github.com/google/closure-compiler/issues/766","id":53153489,"number":766,"title":"The typechecker should know that a getelem on a Uint8Array is a number","user":{"login":"MatrixFrog","id":244381,"avatar_url":"https://avatars.githubusercontent.com/u/244381?v=3","gravatar_id":"","url":"https://api.github.com/users/MatrixFrog","html_url":"https://github.com/MatrixFrog","followers_url":"https://api.github.com/users/MatrixFrog/followers","following_url":"https://api.github.com/users/MatrixFrog/following{/other_user}","gists_url":"https://api.github.com/users/MatrixFrog/gists{/gist_id}","starred_url":"https://api.github.com/users/MatrixFrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatrixFrog/subscriptions","organizations_url":"https://api.github.com/users/MatrixFrog/orgs","repos_url":"https://api.github.com/users/MatrixFrog/repos","events_url":"https://api.github.com/users/MatrixFrog/events{/privacy}","received_events_url":"https://api.github.com/users/MatrixFrog/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/closure-compiler/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/google/closure-compiler/labels/NTI","name":"NTI","color":"006b75"},{"url":"https://api.github.com/repos/google/closure-compiler/labels/P3","name":"P3","color":"006b75"},{"url":"https://api.github.com/repos/google/closure-compiler/labels/Types","name":"Types","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"dimvar","id":286890,"avatar_url":"https://avatars.githubusercontent.com/u/286890?v=3","gravatar_id":"","url":"https://api.github.com/users/dimvar","html_url":"https://github.com/dimvar","followers_url":"https://api.github.com/users/dimvar/followers","following_url":"https://api.github.com/users/dimvar/following{/other_user}","gists_url":"https://api.github.com/users/dimvar/gists{/gist_id}","starred_url":"https://api.github.com/users/dimvar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimvar/subscriptions","organizations_url":"https://api.github.com/users/dimvar/orgs","repos_url":"https://api.github.com/users/dimvar/repos","events_url":"https://api.github.com/users/dimvar/events{/privacy}","received_events_url":"https://api.github.com/users/dimvar/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2014-12-30T22:41:37Z","updated_at":"2015-05-12T05:13:37Z","closed_at":null,"body":"https://groups.google.com/d/topic/closure-compiler-discuss/x4nqNZcIIgg/discussion\r\n\r\nIf you have an `Array<number>` \"arr\" then the typechecker knows that `arr[0]` is a number. It should also know that for `Uint8Array`, `Int8Array`, etc.\r\n\r\n    /** @type {Array<number>} */\r\n    var arr = [5];\r\n    var y = arr[0];\r\n    f(y);  // type mismatch\r\n    \r\n    var typedArr = new Uint8Array([]);\r\n    var x = typedArr[0];\r\n    f(x);  // should be a type mismatch but there is no warning\r\n\r\nhttps://closure-compiler-debugger.appspot.com/#input0%3D%252F**%2520%2540type%2520%257BArray%253Cnumber%253E%257D%2520*%252F%250Avar%2520arr%2520%253D%2520%255B5%255D%253B%250Avar%2520y%2520%253D%2520arr%255B0%255D%253B%250Af(y)%253B%2520%2520%252F%252F%2520type%2520mismatch%250A%250Avar%2520typedArr%2520%253D%2520new%2520Uint8Array(%255B%255D)%253B%250Avar%2520x%2520%253D%2520typedArr%255B0%255D%253B%250Af(x)%253B%2520%2520%252F%252F%2520should%2520be%2520a%2520type%2520mismatch%2520but%2520there%2520is%2520no%2520warning%250A%250A%26input1%26conformanceConfig%26externs%3Dfunction%2520f(%252F**%2520string%2520*%252F%2520x)%2520%257B%257D%26refasterjs-template%26includeDefaultExterns%3D1%26CHECK_SYMBOLS%3D1%26CHECK_TYPES%3D1%26MISSING_PROPERTIES%3D1"},"comment":{"url":"https://api.github.com/repos/google/closure-compiler/issues/comments/101134682","html_url":"https://github.com/google/closure-compiler/issues/766#issuecomment-101134682","issue_url":"https://api.github.com/repos/google/closure-compiler/issues/766","id":101134682,"user":{"login":"concavelenz","id":1245994,"avatar_url":"https://avatars.githubusercontent.com/u/1245994?v=3","gravatar_id":"","url":"https://api.github.com/users/concavelenz","html_url":"https://github.com/concavelenz","followers_url":"https://api.github.com/users/concavelenz/followers","following_url":"https://api.github.com/users/concavelenz/following{/other_user}","gists_url":"https://api.github.com/users/concavelenz/gists{/gist_id}","starred_url":"https://api.github.com/users/concavelenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concavelenz/subscriptions","organizations_url":"https://api.github.com/users/concavelenz/orgs","repos_url":"https://api.github.com/users/concavelenz/repos","events_url":"https://api.github.com/users/concavelenz/events{/privacy}","received_events_url":"https://api.github.com/users/concavelenz/received_events","type":"User","site_admin":false},"created_at":"2015-05-12T05:13:37Z","updated_at":"2015-05-12T05:13:37Z","body":"I'm hope my intern will work on this."}}