{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9568","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9568/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9568/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9568/events","html_url":"https://github.com/Microsoft/TypeScript/issues/9568","id":164483327,"number":9568,"title":"Consider allowing users to check for uninitialized values","user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars.githubusercontent.com/u/972891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/In%20Discussion","name":"In Discussion","color":"556b75"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-07-08T08:33:40Z","updated_at":"2016-08-30T06:38:43Z","closed_at":null,"body":"```ts\r\nfunction findMax(nums: number[]) {\r\n    let max: number;\r\n    \r\n    for (let n of nums) {\r\n        // Error: Variable 'max' is used before being assigned.\r\n        if (max === undefined || n > max) {\r\n            max = n;\r\n        }\r\n    }\r\n\r\n    return max;\r\n}\r\n```\r\n\r\nIt would be really great if we could let users write this without needing to change `max`'s type to `number | undefined`."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/243346958","html_url":"https://github.com/Microsoft/TypeScript/issues/9568#issuecomment-243346958","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9568","id":243346958,"user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars.githubusercontent.com/u/972891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T06:38:43Z","updated_at":"2016-08-30T06:38:43Z","body":"@yortus @gcnew good point. At the very least, it's questionable whether using an uninitialized value in a return statement is okay."}}
{"actor":{"display_login":"DanielRosenwasser"}}