{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/872","labels_url":"https://api.github.com/repos/facebook/flow/issues/872/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/872/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/872/events","html_url":"https://github.com/facebook/flow/pull/872","id":108820568,"number":872,"title":"Default param values can reference earlier 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},"labels":[{"url":"https://api.github.com/repos/facebook/flow/labels/CLA%20Signed","name":"CLA Signed","color":"eeeeee"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-29T08:37:58Z","updated_at":"2015-10-22T19:00:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/flow/pulls/872","html_url":"https://github.com/facebook/flow/pull/872","diff_url":"https://github.com/facebook/flow/pull/872.diff","patch_url":"https://github.com/facebook/flow/pull/872.patch"},"body":"Summary: Defer evaluation of default expr until mk_body\r\n\r\nThis commit introduces a module, `Params`, which encapsulates lots of\r\ninformation that was passed around in a tuple of interdependent values\r\nbetween the various functions that build up function types.\r\n\r\nThe original motivation for this refactor was to defer the evaluation of\r\nthe default expressions. Adding yet another value to the \"params_ret\"\r\ntuple was a step in the wrong direction, so I tried something else.\r\n\r\nThis also fixes a case where users could force an unexpected BoundT\r\nerror, by adding a default expr to a generically-typed param. Now the\r\ndefault expr is evaluated within the generate_test callback.\r\n\r\nThis commit is larger and noisier than I wanted it to be, which is a\r\nconsequence of the added module. The module depends on some functions,\r\nand other functions depend on the module, but all of those functions\r\nwere simultaneously declared with `and`. In order to define the module,\r\nI needed to split the declarations, which involved moving some\r\ndeclarations up. If there is a better way to organize this with less\r\nchurn, I'd be happy to learn it.\r\n\r\nFixes #827"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/150323272","html_url":"https://github.com/facebook/flow/pull/872#issuecomment-150323272","issue_url":"https://api.github.com/repos/facebook/flow/issues/872","id":150323272,"user":{"login":"mroch","id":3012,"avatar_url":"https://avatars.githubusercontent.com/u/3012?v=3","gravatar_id":"","url":"https://api.github.com/users/mroch","html_url":"https://github.com/mroch","followers_url":"https://api.github.com/users/mroch/followers","following_url":"https://api.github.com/users/mroch/following{/other_user}","gists_url":"https://api.github.com/users/mroch/gists{/gist_id}","starred_url":"https://api.github.com/users/mroch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mroch/subscriptions","organizations_url":"https://api.github.com/users/mroch/orgs","repos_url":"https://api.github.com/users/mroch/repos","events_url":"https://api.github.com/users/mroch/events{/privacy}","received_events_url":"https://api.github.com/users/mroch/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T19:00:10Z","updated_at":"2015-10-22T19:00:10Z","body":"#878 is in... sorry about the delay.\r\n\r\n![bashful dog](http://media.giphy.com/media/bQ4qx1qT28rHG/giphy.gif)"}}