{"action":"closed","number":541,"pull_request":{"url":"https://api.github.com/repos/facebook/flow/pulls/541","id":38061293,"html_url":"https://github.com/facebook/flow/pull/541","diff_url":"https://github.com/facebook/flow/pull/541.diff","patch_url":"https://github.com/facebook/flow/pull/541.patch","issue_url":"https://api.github.com/repos/facebook/flow/issues/541","number":541,"state":"closed","locked":false,"title":"Allow `undefined` to be passed to optional params","user":{"login":"samwgoldman","id":254842,"avatar_url":"https://avatars.githubusercontent.com/u/254842?v=3","gravatar_id":"","url":"https://api.github.com/users/samwgoldman","html_url":"https://github.com/samwgoldman","followers_url":"https://api.github.com/users/samwgoldman/followers","following_url":"https://api.github.com/users/samwgoldman/following{/other_user}","gists_url":"https://api.github.com/users/samwgoldman/gists{/gist_id}","starred_url":"https://api.github.com/users/samwgoldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwgoldman/subscriptions","organizations_url":"https://api.github.com/users/samwgoldman/orgs","repos_url":"https://api.github.com/users/samwgoldman/repos","events_url":"https://api.github.com/users/samwgoldman/events{/privacy}","received_events_url":"https://api.github.com/users/samwgoldman/received_events","type":"User","site_admin":false},"body":"There is already a flow for `VoidT ~> OptionalT`, but in the case of\r\nfunction parameters, `multiflow` actually unwraps the `OptionalT`, so by\r\nthe argument flows into the parameter, flow isn't able to detect this\r\ncase.\r\n\r\nI fixed this by adding a redundant case to `multiflow` instead of a\r\nlarger overhaul that would use the existing flow.\r\n\r\nNote that functions with default argument values use the same mechanism\r\nas optional parameters. The included test ensures that the default\r\nexpression type still flows correctly.\r\n\r\nFixes #437","created_at":"2015-06-18T22:44:55Z","updated_at":"2015-06-20T06:39:36Z","closed_at":"2015-06-20T06:39:36Z","merged_at":"2015-06-20T06:39:36Z","merge_commit_sha":"1fa5cc8fd72b7d9ac5c7d557bf32f18a973ad722","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/flow/pulls/541/commits","review_comments_url":"https://api.github.com/repos/facebook/flow/pulls/541/comments","review_comment_url":"https://api.github.com/repos/facebook/flow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/flow/issues/541/comments","statuses_url":"https://api.github.com/repos/facebook/flow/statuses/e2275aa24c526692e543f70afed6f6b0ff237e97","head":{"label":"samwgoldman:explicit-undefined-to-optional","ref":"explicit-undefined-to-optional","sha":"e2275aa24c526692e543f70afed6f6b0ff237e97","user":{"login":"samwgoldman","id":254842,"avatar_url":"https://avatars.githubusercontent.com/u/254842?v=3","gravatar_id":"","url":"https://api.github.com/users/samwgoldman","html_url":"https://github.com/samwgoldman","followers_url":"https://api.github.com/users/samwgoldman/followers","following_url":"https://api.github.com/users/samwgoldman/following{/other_user}","gists_url":"https://api.github.com/users/samwgoldman/gists{/gist_id}","starred_url":"https://api.github.com/users/samwgoldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwgoldman/subscriptions","organizations_url":"https://api.github.com/users/samwgoldman/orgs","repos_url":"https://api.github.com/users/samwgoldman/repos","events_url":"https://api.github.com/users/samwgoldman/events{/privacy}","received_events_url":"https://api.github.com/users/samwgoldman/received_events","type":"User","site_admin":false},"repo":{"id":31458997,"name":"flow","full_name":"samwgoldman/flow","owner":{"login":"samwgoldman","id":254842,"avatar_url":"https://avatars.githubusercontent.com/u/254842?v=3","gravatar_id":"","url":"https://api.github.com/users/samwgoldman","html_url":"https://github.com/samwgoldman","followers_url":"https://api.github.com/users/samwgoldman/followers","following_url":"https://api.github.com/users/samwgoldman/following{/other_user}","gists_url":"https://api.github.com/users/samwgoldman/gists{/gist_id}","starred_url":"https://api.github.com/users/samwgoldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwgoldman/subscriptions","organizations_url":"https://api.github.com/users/samwgoldman/orgs","repos_url":"https://api.github.com/users/samwgoldman/repos","events_url":"https://api.github.com/users/samwgoldman/events{/privacy}","received_events_url":"https://api.github.com/users/samwgoldman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samwgoldman/flow","description":"Adds static typing to JavaScript to improve developer productivity and code quality.","fork":true,"url":"https://api.github.com/repos/samwgoldman/flow","forks_url":"https://api.github.com/repos/samwgoldman/flow/forks","keys_url":"https://api.github.com/repos/samwgoldman/flow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samwgoldman/flow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samwgoldman/flow/teams","hooks_url":"https://api.github.com/repos/samwgoldman/flow/hooks","issue_events_url":"https://api.github.com/repos/samwgoldman/flow/issues/events{/number}","events_url":"https://api.github.com/repos/samwgoldman/flow/events","assignees_url":"https://api.github.com/repos/samwgoldman/flow/assignees{/user}","branches_url":"https://api.github.com/repos/samwgoldman/flow/branches{/branch}","tags_url":"https://api.github.com/repos/samwgoldman/flow/tags","blobs_url":"https://api.github.com/repos/samwgoldman/flow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samwgoldman/flow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samwgoldman/flow/git/refs{/sha}","trees_url":"https://api.github.com/repos/samwgoldman/flow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samwgoldman/flow/statuses/{sha}","languages_url":"https://api.github.com/repos/samwgoldman/flow/languages","stargazers_url":"https://api.github.com/repos/samwgoldman/flow/stargazers","contributors_url":"https://api.github.com/repos/samwgoldman/flow/contributors","subscribers_url":"https://api.github.com/repos/samwgoldman/flow/subscribers","subscription_url":"https://api.github.com/repos/samwgoldman/flow/subscription","commits_url":"https://api.github.com/repos/samwgoldman/flow/commits{/sha}","git_commits_url":"https://api.github.com/repos/samwgoldman/flow/git/commits{/sha}","comments_url":"https://api.github.com/repos/samwgoldman/flow/comments{/number}","issue_comment_url":"https://api.github.com/repos/samwgoldman/flow/issues/comments{/number}","contents_url":"https://api.github.com/repos/samwgoldman/flow/contents/{+path}","compare_url":"https://api.github.com/repos/samwgoldman/flow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samwgoldman/flow/merges","archive_url":"https://api.github.com/repos/samwgoldman/flow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samwgoldman/flow/downloads","issues_url":"https://api.github.com/repos/samwgoldman/flow/issues{/number}","pulls_url":"https://api.github.com/repos/samwgoldman/flow/pulls{/number}","milestones_url":"https://api.github.com/repos/samwgoldman/flow/milestones{/number}","notifications_url":"https://api.github.com/repos/samwgoldman/flow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samwgoldman/flow/labels{/name}","releases_url":"https://api.github.com/repos/samwgoldman/flow/releases{/id}","created_at":"2015-02-28T10:12:19Z","updated_at":"2015-05-07T21:57:52Z","pushed_at":"2015-06-20T00:12:21Z","git_url":"git://github.com/samwgoldman/flow.git","ssh_url":"git@github.com:samwgoldman/flow.git","clone_url":"https://github.com/samwgoldman/flow.git","svn_url":"https://github.com/samwgoldman/flow","homepage":"http://flowtype.org/","size":65677,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"f413b2aead6d8e1440e718c017dfec2f3066c57d","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":25880891,"name":"flow","full_name":"facebook/flow","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/flow","description":"Adds static typing to JavaScript to improve developer productivity and code quality.","fork":false,"url":"https://api.github.com/repos/facebook/flow","forks_url":"https://api.github.com/repos/facebook/flow/forks","keys_url":"https://api.github.com/repos/facebook/flow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/flow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/flow/teams","hooks_url":"https://api.github.com/repos/facebook/flow/hooks","issue_events_url":"https://api.github.com/repos/facebook/flow/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/flow/events","assignees_url":"https://api.github.com/repos/facebook/flow/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/flow/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/flow/tags","blobs_url":"https://api.github.com/repos/facebook/flow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/flow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/flow/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/flow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/flow/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/flow/languages","stargazers_url":"https://api.github.com/repos/facebook/flow/stargazers","contributors_url":"https://api.github.com/repos/facebook/flow/contributors","subscribers_url":"https://api.github.com/repos/facebook/flow/subscribers","subscription_url":"https://api.github.com/repos/facebook/flow/subscription","commits_url":"https://api.github.com/repos/facebook/flow/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/flow/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/flow/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/flow/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/flow/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/flow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/flow/merges","archive_url":"https://api.github.com/repos/facebook/flow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/flow/downloads","issues_url":"https://api.github.com/repos/facebook/flow/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/flow/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/flow/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/flow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/flow/labels{/name}","releases_url":"https://api.github.com/repos/facebook/flow/releases{/id}","created_at":"2014-10-28T17:17:45Z","updated_at":"2015-06-20T05:53:48Z","pushed_at":"2015-06-20T06:39:36Z","git_url":"git://github.com/facebook/flow.git","ssh_url":"git@github.com:facebook/flow.git","clone_url":"https://github.com/facebook/flow.git","svn_url":"https://github.com/facebook/flow","homepage":"http://flowtype.org/","size":103408,"stargazers_count":4746,"watchers_count":4746,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":237,"mirror_url":null,"open_issues_count":211,"forks":237,"open_issues":211,"watchers":4746,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/flow/pulls/541"},"html":{"href":"https://github.com/facebook/flow/pull/541"},"issue":{"href":"https://api.github.com/repos/facebook/flow/issues/541"},"comments":{"href":"https://api.github.com/repos/facebook/flow/issues/541/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/flow/pulls/541/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/flow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/flow/pulls/541/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/flow/statuses/e2275aa24c526692e543f70afed6f6b0ff237e97"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"avikchaudhuri","id":5328177,"avatar_url":"https://avatars.githubusercontent.com/u/5328177?v=3","gravatar_id":"","url":"https://api.github.com/users/avikchaudhuri","html_url":"https://github.com/avikchaudhuri","followers_url":"https://api.github.com/users/avikchaudhuri/followers","following_url":"https://api.github.com/users/avikchaudhuri/following{/other_user}","gists_url":"https://api.github.com/users/avikchaudhuri/gists{/gist_id}","starred_url":"https://api.github.com/users/avikchaudhuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avikchaudhuri/subscriptions","organizations_url":"https://api.github.com/users/avikchaudhuri/orgs","repos_url":"https://api.github.com/users/avikchaudhuri/repos","events_url":"https://api.github.com/users/avikchaudhuri/events{/privacy}","received_events_url":"https://api.github.com/users/avikchaudhuri/received_events","type":"User","site_admin":false},"comments":9,"review_comments":0,"commits":4,"additions":13,"deletions":17,"changed_files":2}}