{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13142","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13142/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13142/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13142/events","html_url":"https://github.com/Microsoft/TypeScript/issues/13142","id":197341876,"number":13142,"title":"CFA not work in function","user":{"login":"twoeo","id":1681689,"avatar_url":"https://avatars.githubusercontent.com/u/1681689?v=3","gravatar_id":"","url":"https://api.github.com/users/twoeo","html_url":"https://github.com/twoeo","followers_url":"https://api.github.com/users/twoeo/followers","following_url":"https://api.github.com/users/twoeo/following{/other_user}","gists_url":"https://api.github.com/users/twoeo/gists{/gist_id}","starred_url":"https://api.github.com/users/twoeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twoeo/subscriptions","organizations_url":"https://api.github.com/users/twoeo/orgs","repos_url":"https://api.github.com/users/twoeo/repos","events_url":"https://api.github.com/users/twoeo/events{/privacy}","received_events_url":"https://api.github.com/users/twoeo/received_events","type":"User","site_admin":false},"labels":[{"id":113971226,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Duplicate","name":"Duplicate","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-23T10:01:03Z","updated_at":"2016-12-27T05:47:11Z","closed_at":"2016-12-27T05:47:11Z","body":"<!-- BUGS: Please use this template. -->\r\n<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:**  2.1.1 / nightly (2.2.0-dev.201xxxxx)\r\n2.1.4\r\n\r\n**Code**\r\n\r\n```ts\r\nlet f:string | null = 'xx';\r\nlet v:string;\r\nif(f){\r\n    [].forEach(item=>{\r\n        v = f;\r\n    })\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nCompile successfully\r\n\r\n**Actual behavior:**\r\n> test.ts(5,9): error TS2322: Type 'string | null' is not assignable to type 'string'.\r\n  Type 'null' is not assignable to type 'string'."}}
{"actor":{"display_login":"DanielRosenwasser"}}