{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/flow/pulls/comments/38375546","id":38375546,"diff_hunk":"@@ -930,8 +930,12 @@ and convert_qualification ?(lookup_mode=ForType) cx reason_prefix\n )\n \n and mk_rest cx = function\n-  | ArrT(_, t, []) -> RestT t\n+  | ArrT (_, t, []) -> RestT t\n   | AnyT _ as t -> RestT t\n+  | ArrT (r, t, _) ->\n+      let msg = \"Tuple type should not be used to annotate rest parameters\" in","path":"src/typing/type_inference_js.ml","position":null,"original_position":8,"commit_id":"78d648cd67894a13ab80e1984d60cadf7a9ada69","original_commit_id":"cc0e182aeaf2f5cbb9c3b9113202713ea69bfece","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":"Good idea! Pushed a change.","created_at":"2015-09-01T00:28:33Z","updated_at":"2015-09-01T00:28:33Z","html_url":"https://github.com/facebook/flow/pull/763#discussion_r38375546","pull_request_url":"https://api.github.com/repos/facebook/flow/pulls/763","_links":{"self":{"href":"https://api.github.com/repos/facebook/flow/pulls/comments/38375546"},"html":{"href":"https://github.com/facebook/flow/pull/763#discussion_r38375546"},"pull_request":{"href":"https://api.github.com/repos/facebook/flow/pulls/763"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/flow/pulls/763","id":43732409,"html_url":"https://github.com/facebook/flow/pull/763","diff_url":"https://github.com/facebook/flow/pull/763.diff","patch_url":"https://github.com/facebook/flow/pull/763.patch","issue_url":"https://api.github.com/repos/facebook/flow/issues/763","number":763,"state":"open","locked":false,"title":"Warn when rest parameters are annotated with a tuple type","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":"Before this change, annotating a rest parameter with a tuple type could\r\nlead to an ugly exception, \"Did not expect BoundT\"\r\n\r\nInstead, warn the user when this pattern occurs, because a tuple type\r\ndoes not represent rest parameters well. The tuple type implies a fixed\r\nnumber of elements, but there can be any number of rest parameters, by\r\ndefinition.\r\n\r\nWhile debugging this, I also noticed an issue with bound type parameters\r\nin another rest parameter use case: `fn<T>(...xs: T)`. Currently, this\r\nalso throws the ugly exception, but it's a bit tricker to resolve\r\nbecause the error is thrown from the unification that occurs before the\r\ntype param can be substituted.\r\n\r\nFixes #762","created_at":"2015-08-31T05:11:56Z","updated_at":"2015-09-01T00:28:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"148238160963dd6c9203a75f5ef87f2c50385e87","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/flow/pulls/763/commits","review_comments_url":"https://api.github.com/repos/facebook/flow/pulls/763/comments","review_comment_url":"https://api.github.com/repos/facebook/flow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/flow/issues/763/comments","statuses_url":"https://api.github.com/repos/facebook/flow/statuses/78d648cd67894a13ab80e1984d60cadf7a9ada69","head":{"label":"samwgoldman:subst-poly-tuple-rest-params","ref":"subst-poly-tuple-rest-params","sha":"78d648cd67894a13ab80e1984d60cadf7a9ada69","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-09-01T00:28:25Z","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":68326,"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":"a5c65ed334b36b0c908377767699fd58b222c074","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-08-31T23:21:52Z","pushed_at":"2015-09-01T00:28:25Z","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":112776,"stargazers_count":5210,"watchers_count":5210,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":286,"mirror_url":null,"open_issues_count":244,"forks":286,"open_issues":244,"watchers":5210,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/flow/pulls/763"},"html":{"href":"https://github.com/facebook/flow/pull/763"},"issue":{"href":"https://api.github.com/repos/facebook/flow/issues/763"},"comments":{"href":"https://api.github.com/repos/facebook/flow/issues/763/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/flow/pulls/763/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/flow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/flow/pulls/763/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/flow/statuses/78d648cd67894a13ab80e1984d60cadf7a9ada69"}}}}