{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/2222","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/2222/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/2222/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/2222/events","html_url":"https://github.com/facebook/flow/issues/2222","id":170274152,"number":2222,"title":"Doesn't understand closed optional variables type inside of the local function","user":{"login":"emirotin","id":525832,"avatar_url":"https://avatars.githubusercontent.com/u/525832?v=3","gravatar_id":"","url":"https://api.github.com/users/emirotin","html_url":"https://github.com/emirotin","followers_url":"https://api.github.com/users/emirotin/followers","following_url":"https://api.github.com/users/emirotin/following{/other_user}","gists_url":"https://api.github.com/users/emirotin/gists{/gist_id}","starred_url":"https://api.github.com/users/emirotin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emirotin/subscriptions","organizations_url":"https://api.github.com/users/emirotin/orgs","repos_url":"https://api.github.com/users/emirotin/repos","events_url":"https://api.github.com/users/emirotin/events{/privacy}","received_events_url":"https://api.github.com/users/emirotin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-09T21:21:55Z","updated_at":"2016-08-09T21:37:41Z","closed_at":null,"body":"The issue title doesn't explain it all\r\nThe thing is: if I have an optional function param it's fine to access it inside of the proper conditional branch. But it's not fine to define a function enclosing this param - even inside of the same branch.\r\n\r\nHere's an example: https://flowtype.org/try/#0PQKgBAAgZgNg9gdzCYAoVUCuA7AxgFwEs5sx8AnAQ2wGcZL8BTACgGtGBPALjBosOwBzADRkA-DwDeYANrtuvfkIC6PPuQGCwAXwCUapVsmowYQlDDN8YAIQBeMNkwwYusMdOngwXCT5kqWnp8OHIwB3lwgD4yOU5lE09yRnxMclJ8OI5lAG5E7UTk1PSweTyCoA\r\n\r\nI can access the `t` param property just OK.\r\nNow try uncommenting the line 5.\r\n\r\nThis example is exotic (I don't need the translator function), but sometimes it's required:\r\nhttps://flowtype.org/try/#0PTAEAEDMBsHsHcBQiDGsB2BnALqbAnAQy2kOwFMAFQogW01AF5QAKRUUAV32gC5Qc+AJboA5gBp2XHtTqYA-PwDeoANoBrcgE9+gkaIC6ugvtABfRAEpjwsUwB8oJVOjlcAB1jvOpCgBMAVR4maWhkDiFIVm5oWUJ6UABCZnQfaEsnKQ40LFx8cndSFHJ8ENoyFAALB1C4+lVy7CqAOkxOACM9MRYARksDLNBPb19yQODmGOb8wsJilmBeVQA9YAMAamAJUBmiksspCylI1mGfMjGg6GaRFGhOP3JMFgByXhfLDOcODmxK-AQoHQ5HgoAAovgAfgWAADADKsFo5FAAQASgAZIY0eIMdCwDxec7+UCQWClAAkShiZn4lLOo3G0DMMIOHAsHHy2G46CGhIZV0QZiAA"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/238699887","html_url":"https://github.com/facebook/flow/issues/2222#issuecomment-238699887","issue_url":"https://api.github.com/repos/facebook/flow/issues/2222","id":238699887,"user":{"login":"emirotin","id":525832,"avatar_url":"https://avatars.githubusercontent.com/u/525832?v=3","gravatar_id":"","url":"https://api.github.com/users/emirotin","html_url":"https://github.com/emirotin","followers_url":"https://api.github.com/users/emirotin/followers","following_url":"https://api.github.com/users/emirotin/following{/other_user}","gists_url":"https://api.github.com/users/emirotin/gists{/gist_id}","starred_url":"https://api.github.com/users/emirotin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emirotin/subscriptions","organizations_url":"https://api.github.com/users/emirotin/orgs","repos_url":"https://api.github.com/users/emirotin/repos","events_url":"https://api.github.com/users/emirotin/events{/privacy}","received_events_url":"https://api.github.com/users/emirotin/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T21:37:41Z","updated_at":"2016-08-09T21:37:41Z","body":"> but I guess flow is not smart enough\r\n\r\nthat's why I've filed this issue"}}
{"actor":{"display_login":"emirotin"}}