{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/1954","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/1954/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/1954/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/1954/events","html_url":"https://github.com/facebook/flow/issues/1954","id":160604573,"number":1954,"title":"nonexisting field read is allowed in an `if`","user":{"login":"sakari","id":379600,"avatar_url":"https://avatars3.githubusercontent.com/u/379600?v=3","gravatar_id":"","url":"https://api.github.com/users/sakari","html_url":"https://github.com/sakari","followers_url":"https://api.github.com/users/sakari/followers","following_url":"https://api.github.com/users/sakari/following{/other_user}","gists_url":"https://api.github.com/users/sakari/gists{/gist_id}","starred_url":"https://api.github.com/users/sakari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakari/subscriptions","organizations_url":"https://api.github.com/users/sakari/orgs","repos_url":"https://api.github.com/users/sakari/repos","events_url":"https://api.github.com/users/sakari/events{/privacy}","received_events_url":"https://api.github.com/users/sakari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-16T08:24:59Z","updated_at":"2017-03-24T21:22:55Z","closed_at":null,"body":"I understand that the check for existence of `falg` makes it kinda ok (from typing perspective) to read the value but it is a source of great many program errors that a mistyped field is falsy in comparisons like this.\n\n```\nclass Foo {\n    flag: boolean;\n\n    constructor() {\n        this.flag = true\n    }\n\n    noerror() {\n        if(this.falg)\n            console.log('whoohaa')\n    }\n}\n```\n\nhaving to type `if(this.flag === true)` or something like that feels a bit tedious and easy to miss coming from straight up javascript.\n\nIs there any way to prevent undeclared field reads here? In typescript the typechecker detects this so I assume that it is possible.\n"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/289146260","html_url":"https://github.com/facebook/flow/issues/1954#issuecomment-289146260","issue_url":"https://api.github.com/repos/facebook/flow/issues/1954","id":289146260,"user":{"login":"gopritescu","id":20815278,"avatar_url":"https://avatars3.githubusercontent.com/u/20815278?v=3","gravatar_id":"","url":"https://api.github.com/users/gopritescu","html_url":"https://github.com/gopritescu","followers_url":"https://api.github.com/users/gopritescu/followers","following_url":"https://api.github.com/users/gopritescu/following{/other_user}","gists_url":"https://api.github.com/users/gopritescu/gists{/gist_id}","starred_url":"https://api.github.com/users/gopritescu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gopritescu/subscriptions","organizations_url":"https://api.github.com/users/gopritescu/orgs","repos_url":"https://api.github.com/users/gopritescu/repos","events_url":"https://api.github.com/users/gopritescu/events{/privacy}","received_events_url":"https://api.github.com/users/gopritescu/received_events","type":"User","site_admin":false},"created_at":"2017-03-24T21:22:55Z","updated_at":"2017-03-24T21:22:55Z","body":"Seeing this as well with 0.42.0"}}
{"actor":{"display_login":"gopritescu"}}