{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/1447","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/1447/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/1447/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/1447/events","html_url":"https://github.com/facebook/flow/issues/1447","id":136185093,"number":1447,"title":"(regression) Wrong type mutation across file boundaries","user":{"login":"pasha-mf","id":11412485,"avatar_url":"https://avatars.githubusercontent.com/u/11412485?v=3","gravatar_id":"","url":"https://api.github.com/users/pasha-mf","html_url":"https://github.com/pasha-mf","followers_url":"https://api.github.com/users/pasha-mf/followers","following_url":"https://api.github.com/users/pasha-mf/following{/other_user}","gists_url":"https://api.github.com/users/pasha-mf/gists{/gist_id}","starred_url":"https://api.github.com/users/pasha-mf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasha-mf/subscriptions","organizations_url":"https://api.github.com/users/pasha-mf/orgs","repos_url":"https://api.github.com/users/pasha-mf/repos","events_url":"https://api.github.com/users/pasha-mf/events{/privacy}","received_events_url":"https://api.github.com/users/pasha-mf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-24T21:01:16Z","updated_at":"2016-02-24T23:25:03Z","closed_at":"2016-02-24T22:56:28Z","body":"Flow version v0.22.0 [cf1a279ff382932c6bf9978f057b67358ec8b258], the problem didn't occur in v0.21.\r\n## File 1\r\n```\r\n/* @flow */\r\nexport type Result = ?React.Element;\r\n\r\n(<div>spoiler</div>: Result);\r\n```\r\n\r\n## File 2\r\n```\r\n/* @flow */\r\nimport type {Result} from \"./file1.js\";\r\n\r\n(<div>test</div>: Result);\r\n```\r\n\r\nThis setup produces\r\n```\r\njs/file2.js:4\r\n  4: (<div>test</div>: Result);\r\n      ^^^^^ React element: `div`\r\n  4: (<div>test</div>: Result);\r\n      ^^^^^ React$Element. This type is incompatible with\r\n  4: (<div>test</div>: Result);\r\n                       ^^^^^^ Element\r\n```\r\n\r\nThe error goes away if I were to replace `?React.Element` with `?React$Element`, or with `React.Element`, or remove \"spoiler\" from file1. However I feel that if one declares a type in a particular way, that definition should remain constant regardless of the circumstances of its use..."},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/188512726","html_url":"https://github.com/facebook/flow/issues/1447#issuecomment-188512726","issue_url":"https://api.github.com/repos/facebook/flow/issues/1447","id":188512726,"user":{"login":"pasha-mf","id":11412485,"avatar_url":"https://avatars.githubusercontent.com/u/11412485?v=3","gravatar_id":"","url":"https://api.github.com/users/pasha-mf","html_url":"https://github.com/pasha-mf","followers_url":"https://api.github.com/users/pasha-mf/followers","following_url":"https://api.github.com/users/pasha-mf/following{/other_user}","gists_url":"https://api.github.com/users/pasha-mf/gists{/gist_id}","starred_url":"https://api.github.com/users/pasha-mf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasha-mf/subscriptions","organizations_url":"https://api.github.com/users/pasha-mf/orgs","repos_url":"https://api.github.com/users/pasha-mf/repos","events_url":"https://api.github.com/users/pasha-mf/events{/privacy}","received_events_url":"https://api.github.com/users/pasha-mf/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T23:25:02Z","updated_at":"2016-02-24T23:25:02Z","body":"Well, I have a global declaration `declare var React: React;`, which works fine everywhere else but here..."}}