{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/6176","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/6176/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/6176/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/6176/events","html_url":"https://github.com/facebook/flow/pull/6176","id":316144759,"number":6176,"title":"Update JSX typing to allow exact object splats","user":{"login":"danwang","id":935063,"avatar_url":"https://avatars1.githubusercontent.com/u/935063?v=4","gravatar_id":"","url":"https://api.github.com/users/danwang","html_url":"https://github.com/danwang","followers_url":"https://api.github.com/users/danwang/followers","following_url":"https://api.github.com/users/danwang/following{/other_user}","gists_url":"https://api.github.com/users/danwang/gists{/gist_id}","starred_url":"https://api.github.com/users/danwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danwang/subscriptions","organizations_url":"https://api.github.com/users/danwang/orgs","repos_url":"https://api.github.com/users/danwang/repos","events_url":"https://api.github.com/users/danwang/events{/privacy}","received_events_url":"https://api.github.com/users/danwang/received_events","type":"User","site_admin":false},"labels":[{"id":196859323,"url":"https://api.github.com/repos/facebook/flow/labels/CLA%20Signed","name":"CLA Signed","color":"eeeeee","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-20T06:35:56Z","updated_at":"2018-05-01T20:52:48Z","closed_at":"2018-05-01T20:10:50Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/facebook/flow/pulls/6176","html_url":"https://github.com/facebook/flow/pull/6176","diff_url":"https://github.com/facebook/flow/pull/6176.diff","patch_url":"https://github.com/facebook/flow/pull/6176.patch"},"body":"## Summary\r\nAdjusts rules for JSX so that splats can work with components that expect exact object types.\r\n\r\nI updated the tests:\r\n- There were flow errors that are no longer flow errors because the \"incompatible with exact type ...\" error is not surfaced anymore. I updated the `Error: ...` comment and expectation file.\r\n- There were some existing lines in the **.exp** file that had `// OK` comment, but resulted in a Flow error. They still have a Flow error, but I changed the comment to reflect the behavior. \r\n- Added some test cases to check for the new behavior\r\n\r\nThanks for your time!\r\n\r\n## Motivation\r\nSome examples ([flow try link](https://flow.org/try/#0JYWwDg9gTgLgBAKjgQwM5wEoFNkGN4BmUEIcA5FDvmQNwBQduEAdqvACQCuzoYANlhBZmMLABMAXCmYBPOAF44ANnowZYLHACiADzwwACsTDpFAbwA+yKWyjBmAcwA0cAEZTmnEK6xQLAX3omVnhdfQBhEkhmYRgpbH0AOkjwFliAFXUsAB4w-CMIEwA+BTguHnABIRFxejoAenq4dIALYHQxCCxUZjJ4AHdoAGsXV054YHhUFohOPjE6XL18FOjYuDNErbNrcmQyUakARn9-OHqihkbmto6unr64QagRt3G4Sbhp2fnGFjY4GBjKgpHlDMDSjspGR9oc4Cd6EsIlE0iINltEkDCqgzhcrk1Wu04J1ur0BsNRu9Pt85gtggD7ARfJQxJDdjCDm5joFFmDVqj4JstozmeJcZcGgTbsT7mSnhS3hMpjNaX8QoDkLBgMg+GzofseUiViiYmihZjNTBtXwzq55GYTucikA)):\r\n```jsx\r\ntype ExactProps = {|a: string, b: number|};\r\nconst ExactComponent: React.ComponentType<ExactProps> = ...;\r\n\r\n// This doesn't work, but it should\r\n<ExactComponent {...{a: 'a', b: 1}} />\r\n\r\n// This doesn't work, but it should\r\nconst props: ExactProps = {a: 'a', b: 1};\r\n<ExactComponent {...props} />\r\n\r\n// This doesn't work, but it should\r\nconst inferred = {a: 'a', b: 1};\r\n<ExactComponent {...inferred} />\r\n\r\n// This doesn't work, but it should\r\nconst partial = {a: 'a'};\r\n<ExactComponent {...partial} b={1} />\r\n```\r\n\r\n# TODO\r\nOrder of statements matter now (even though they didn't use to). I think this may be because I'm using **Context.find_resolved**, which returns different results at different points in time of the type checking?\r\n\r\n```jsx\r\n// If ExactProps is defined before, it works, but after fails\r\n<ExactComponent {...(props: ExactProps)} />\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/385786582","html_url":"https://github.com/facebook/flow/pull/6176#issuecomment-385786582","issue_url":"https://api.github.com/repos/facebook/flow/issues/6176","id":385786582,"user":{"login":"danwang","id":935063,"avatar_url":"https://avatars1.githubusercontent.com/u/935063?v=4","gravatar_id":"","url":"https://api.github.com/users/danwang","html_url":"https://github.com/danwang","followers_url":"https://api.github.com/users/danwang/followers","following_url":"https://api.github.com/users/danwang/following{/other_user}","gists_url":"https://api.github.com/users/danwang/gists{/gist_id}","starred_url":"https://api.github.com/users/danwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danwang/subscriptions","organizations_url":"https://api.github.com/users/danwang/orgs","repos_url":"https://api.github.com/users/danwang/repos","events_url":"https://api.github.com/users/danwang/events{/privacy}","received_events_url":"https://api.github.com/users/danwang/received_events","type":"User","site_admin":false},"created_at":"2018-05-01T20:52:47Z","updated_at":"2018-05-01T20:52:47Z","author_association":"NONE","body":"Yes, but 0.71 displays \"No errors!\" more often at the expense of failing to identify bugs. For example:\r\n\r\nhttps://flow.org/try/#0JYWwDg9gTgLgBAKjgQwM5wEoFNkGN4BmUEIcA5FDvmQNwBQuEAdqvACQCuToYANliCxMYWACYAuFEwCecALxwALPToxpYLHAAKxMOgUBvAD504KSayjAmAcwA0dIwF8VjFvADCJSEyExJ2HgwAHRe4Mx+ACrqWAA8OhB6AHzycJzc4PyCwmKuzKxwYLqokgbIFjBWtk6pZZJkyGR2cABG9TAAFsDoANZYsqgdEBy8onBMEPBYAB7dMGQudLFhPkKmZhsEXPjAzHAAYhAQABRYWZJMHCAtWFDNRYkl2sUAlHAGTusbcG4FAELIKCpACMACYAMwqb5mX7wB56UrlOCWaw2GqGJENJqteotBb0aFwWIAoEGYLk+GoGoAeiSNCAA"}}
{"actor":{"display_login":"danwang"}}