{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/6347","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/6347/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/6347/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/6347/events","html_url":"https://github.com/facebook/flow/issues/6347","id":325725034,"node_id":"MDU6SXNzdWUzMjU3MjUwMzQ=","number":6347,"title":"Unexpected behavior of union types","user":{"login":"smikhalevski","id":1029338,"node_id":"MDQ6VXNlcjEwMjkzMzg=","avatar_url":"https://avatars0.githubusercontent.com/u/1029338?v=4","gravatar_id":"","url":"https://api.github.com/users/smikhalevski","html_url":"https://github.com/smikhalevski","followers_url":"https://api.github.com/users/smikhalevski/followers","following_url":"https://api.github.com/users/smikhalevski/following{/other_user}","gists_url":"https://api.github.com/users/smikhalevski/gists{/gist_id}","starred_url":"https://api.github.com/users/smikhalevski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smikhalevski/subscriptions","organizations_url":"https://api.github.com/users/smikhalevski/orgs","repos_url":"https://api.github.com/users/smikhalevski/repos","events_url":"https://api.github.com/users/smikhalevski/events{/privacy}","received_events_url":"https://api.github.com/users/smikhalevski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-05-23T14:12:32Z","updated_at":"2018-05-31T14:11:49Z","closed_at":null,"author_association":"NONE","body":"The following types work as expected:\r\n```js\r\ntype Foo = number | string;\r\ntype Bar = Foo & number;\r\n\r\nconst bar: Bar = 123; // No error here\r\n```\r\n[Try](https://flow.org/try/#0PTAEAEDMBsHsHcBQAXAngBwKagGK1qALygB2ArgLYBGmATqAD6gDOytAliQOYDcKG2AEIBDesTwEAZKUo1afRAGNYJVqCqiAXKBFjQARgBMAZj7LVyUJHzaJRdaIVA)\r\n\r\n\r\nAnd I expected the same behavior with an object structure but it causes an error:\r\n```js\r\ntype Foo = {\r\n  foo: number | string,\r\n};\r\n\r\ntype Bar = Foo & {\r\n  foo: number,\r\n};\r\n\r\n// $ExpectError Woops! string is incompatible with number. Why you no work?!\r\nconst bar: Bar = {\r\n  foo: 123,\r\n};\r\n```\r\n[Try](https://flow.org/try/#0PTAEAEDMBsHsHcBQAXAngBwKagGK1qALygDeiook+AXKAHYCuAtgEaYBOoAPqAM7LsAlnQDmAGkQBfRCgzYAQgENOxPAQBkpcpRr1mbdhMkBuGQGNYdfqBbLaSlVopVYtAIwAmAMxHTQA)\r\n\r\nWhat am I doing wrong?"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/393543407","html_url":"https://github.com/facebook/flow/issues/6347#issuecomment-393543407","issue_url":"https://api.github.com/repos/facebook/flow/issues/6347","id":393543407,"node_id":"MDEyOklzc3VlQ29tbWVudDM5MzU0MzQwNw==","user":{"login":"vkurchatkin","id":2993861,"node_id":"MDQ6VXNlcjI5OTM4NjE=","avatar_url":"https://avatars2.githubusercontent.com/u/2993861?v=4","gravatar_id":"","url":"https://api.github.com/users/vkurchatkin","html_url":"https://github.com/vkurchatkin","followers_url":"https://api.github.com/users/vkurchatkin/followers","following_url":"https://api.github.com/users/vkurchatkin/following{/other_user}","gists_url":"https://api.github.com/users/vkurchatkin/gists{/gist_id}","starred_url":"https://api.github.com/users/vkurchatkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkurchatkin/subscriptions","organizations_url":"https://api.github.com/users/vkurchatkin/orgs","repos_url":"https://api.github.com/users/vkurchatkin/repos","events_url":"https://api.github.com/users/vkurchatkin/events{/privacy}","received_events_url":"https://api.github.com/users/vkurchatkin/received_events","type":"User","site_admin":false},"created_at":"2018-05-31T14:11:49Z","updated_at":"2018-05-31T14:11:49Z","author_association":"COLLABORATOR","body":"@smikhalevski yep, create a new issue and /cc me"}}
{"actor":{"display_login":"vkurchatkin"}}