{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/5174","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/5174/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/5174/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/5174/events","html_url":"https://github.com/facebook/flow/issues/5174","id":267948087,"number":5174,"title":"Function treated as object even though parameter is explicitly notated as object","user":{"login":"vojtatranta","id":4154045,"avatar_url":"https://avatars0.githubusercontent.com/u/4154045?v=4","gravatar_id":"","url":"https://api.github.com/users/vojtatranta","html_url":"https://github.com/vojtatranta","followers_url":"https://api.github.com/users/vojtatranta/followers","following_url":"https://api.github.com/users/vojtatranta/following{/other_user}","gists_url":"https://api.github.com/users/vojtatranta/gists{/gist_id}","starred_url":"https://api.github.com/users/vojtatranta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vojtatranta/subscriptions","organizations_url":"https://api.github.com/users/vojtatranta/orgs","repos_url":"https://api.github.com/users/vojtatranta/repos","events_url":"https://api.github.com/users/vojtatranta/events{/privacy}","received_events_url":"https://api.github.com/users/vojtatranta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-10-24T08:51:36Z","updated_at":"2017-10-24T15:50:38Z","closed_at":null,"author_association":"NONE","body":"This code: \r\n```js\r\n// @flow\r\n\r\nconst fun = (a: string, b: {c?: string, d?: number}) => {\r\n\r\n  return {...b, a}\r\n}\r\n\r\nfun('test', () => ({'a': 'test'}))\r\n```\r\n\r\nDoes not raise an error.\r\n\r\nIt should in my mind raise an error, even though function in Javascript are objects.\r\n\r\nThe problem is apparently in the fact that properties of `b` parameter of `fun` function are not required.\r\n\r\nI understand that functions are objects, but this may lead to the bugs very easily. Is there any way ho to disable this behavior?"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/339037758","html_url":"https://github.com/facebook/flow/issues/5174#issuecomment-339037758","issue_url":"https://api.github.com/repos/facebook/flow/issues/5174","id":339037758,"user":{"login":"jcready","id":358876,"avatar_url":"https://avatars1.githubusercontent.com/u/358876?v=4","gravatar_id":"","url":"https://api.github.com/users/jcready","html_url":"https://github.com/jcready","followers_url":"https://api.github.com/users/jcready/followers","following_url":"https://api.github.com/users/jcready/following{/other_user}","gists_url":"https://api.github.com/users/jcready/gists{/gist_id}","starred_url":"https://api.github.com/users/jcready/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcready/subscriptions","organizations_url":"https://api.github.com/users/jcready/orgs","repos_url":"https://api.github.com/users/jcready/repos","events_url":"https://api.github.com/users/jcready/events{/privacy}","received_events_url":"https://api.github.com/users/jcready/received_events","type":"User","site_admin":false},"created_at":"2017-10-24T15:50:38Z","updated_at":"2017-10-24T15:50:38Z","author_association":"NONE","body":"@AugustinLF for your workaround you should replace `$call: void` with `$call?: empty` otherwise plain objects won't be able to be passed in either:\r\n\r\n```js\r\nfun('test', {})\r\n```"}}
{"actor":{"display_login":"jcready"}}