{"action":"created","comment":{"url":"https://api.github.com/repos/gcanti/tcomb/pulls/comments/38175815","id":38175815,"diff_hunk":"@@ -413,8 +417,15 @@ function union(types, name) {\n \n   Union.dispatch = function (x) { // default dispatch implementation\n     for (var i = 0, len = types.length; i < len; i++ ) {\n-      if (is(x, types[i])) {\n-        return types[i];\n+      var type = types[i];\n+      if (isUnion(type)) {\n+        var t = type.dispatch(x);\n+        if (!isNil(t)) {","path":"index.js","position":20,"original_position":20,"commit_id":"adaa1676258c2e22688dfbcaf050aa1cfdbdfd41","original_commit_id":"adaa1676258c2e22688dfbcaf050aa1cfdbdfd41","user":{"login":"gcanti","id":878912,"avatar_url":"https://avatars.githubusercontent.com/u/878912?v=3","gravatar_id":"","url":"https://api.github.com/users/gcanti","html_url":"https://github.com/gcanti","followers_url":"https://api.github.com/users/gcanti/followers","following_url":"https://api.github.com/users/gcanti/following{/other_user}","gists_url":"https://api.github.com/users/gcanti/gists{/gist_id}","starred_url":"https://api.github.com/users/gcanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcanti/subscriptions","organizations_url":"https://api.github.com/users/gcanti/orgs","repos_url":"https://api.github.com/users/gcanti/repos","events_url":"https://api.github.com/users/gcanti/events{/privacy}","received_events_url":"https://api.github.com/users/gcanti/received_events","type":"User","site_admin":false},"body":"Sure, you are right, thanks","created_at":"2015-08-28T07:17:41Z","updated_at":"2015-08-28T07:17:41Z","html_url":"https://github.com/gcanti/tcomb/pull/128#discussion_r38175815","pull_request_url":"https://api.github.com/repos/gcanti/tcomb/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/gcanti/tcomb/pulls/comments/38175815"},"html":{"href":"https://github.com/gcanti/tcomb/pull/128#discussion_r38175815"},"pull_request":{"href":"https://api.github.com/repos/gcanti/tcomb/pulls/128"}}},"pull_request":{"url":"https://api.github.com/repos/gcanti/tcomb/pulls/128","id":43598671,"html_url":"https://github.com/gcanti/tcomb/pull/128","diff_url":"https://github.com/gcanti/tcomb/pull/128.diff","patch_url":"https://github.com/gcanti/tcomb/pull/128.patch","issue_url":"https://api.github.com/repos/gcanti/tcomb/issues/128","number":128,"state":"open","locked":false,"title":"Union of unions in dispatch method","user":{"login":"jgoux","id":1443499,"avatar_url":"https://avatars.githubusercontent.com/u/1443499?v=3","gravatar_id":"","url":"https://api.github.com/users/jgoux","html_url":"https://github.com/jgoux","followers_url":"https://api.github.com/users/jgoux/followers","following_url":"https://api.github.com/users/jgoux/following{/other_user}","gists_url":"https://api.github.com/users/jgoux/gists{/gist_id}","starred_url":"https://api.github.com/users/jgoux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgoux/subscriptions","organizations_url":"https://api.github.com/users/jgoux/orgs","repos_url":"https://api.github.com/users/jgoux/repos","events_url":"https://api.github.com/users/jgoux/events{/privacy}","received_events_url":"https://api.github.com/users/jgoux/received_events","type":"User","site_admin":false},"body":"Fix https://github.com/gcanti/tcomb/issues/126","created_at":"2015-08-28T06:55:59Z","updated_at":"2015-08-28T07:17:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ad8d6dc92b5e2d2a739b6778c96b8285df9ec5c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gcanti/tcomb/pulls/128/commits","review_comments_url":"https://api.github.com/repos/gcanti/tcomb/pulls/128/comments","review_comment_url":"https://api.github.com/repos/gcanti/tcomb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gcanti/tcomb/issues/128/comments","statuses_url":"https://api.github.com/repos/gcanti/tcomb/statuses/adaa1676258c2e22688dfbcaf050aa1cfdbdfd41","head":{"label":"jgoux:union-of-unions","ref":"union-of-unions","sha":"adaa1676258c2e22688dfbcaf050aa1cfdbdfd41","user":{"login":"jgoux","id":1443499,"avatar_url":"https://avatars.githubusercontent.com/u/1443499?v=3","gravatar_id":"","url":"https://api.github.com/users/jgoux","html_url":"https://github.com/jgoux","followers_url":"https://api.github.com/users/jgoux/followers","following_url":"https://api.github.com/users/jgoux/following{/other_user}","gists_url":"https://api.github.com/users/jgoux/gists{/gist_id}","starred_url":"https://api.github.com/users/jgoux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgoux/subscriptions","organizations_url":"https://api.github.com/users/jgoux/orgs","repos_url":"https://api.github.com/users/jgoux/repos","events_url":"https://api.github.com/users/jgoux/events{/privacy}","received_events_url":"https://api.github.com/users/jgoux/received_events","type":"User","site_admin":false},"repo":{"id":41530712,"name":"tcomb","full_name":"jgoux/tcomb","owner":{"login":"jgoux","id":1443499,"avatar_url":"https://avatars.githubusercontent.com/u/1443499?v=3","gravatar_id":"","url":"https://api.github.com/users/jgoux","html_url":"https://github.com/jgoux","followers_url":"https://api.github.com/users/jgoux/followers","following_url":"https://api.github.com/users/jgoux/following{/other_user}","gists_url":"https://api.github.com/users/jgoux/gists{/gist_id}","starred_url":"https://api.github.com/users/jgoux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgoux/subscriptions","organizations_url":"https://api.github.com/users/jgoux/orgs","repos_url":"https://api.github.com/users/jgoux/repos","events_url":"https://api.github.com/users/jgoux/events{/privacy}","received_events_url":"https://api.github.com/users/jgoux/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jgoux/tcomb","description":"Type checking and DDD for JavaScript","fork":true,"url":"https://api.github.com/repos/jgoux/tcomb","forks_url":"https://api.github.com/repos/jgoux/tcomb/forks","keys_url":"https://api.github.com/repos/jgoux/tcomb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jgoux/tcomb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jgoux/tcomb/teams","hooks_url":"https://api.github.com/repos/jgoux/tcomb/hooks","issue_events_url":"https://api.github.com/repos/jgoux/tcomb/issues/events{/number}","events_url":"https://api.github.com/repos/jgoux/tcomb/events","assignees_url":"https://api.github.com/repos/jgoux/tcomb/assignees{/user}","branches_url":"https://api.github.com/repos/jgoux/tcomb/branches{/branch}","tags_url":"https://api.github.com/repos/jgoux/tcomb/tags","blobs_url":"https://api.github.com/repos/jgoux/tcomb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jgoux/tcomb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jgoux/tcomb/git/refs{/sha}","trees_url":"https://api.github.com/repos/jgoux/tcomb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jgoux/tcomb/statuses/{sha}","languages_url":"https://api.github.com/repos/jgoux/tcomb/languages","stargazers_url":"https://api.github.com/repos/jgoux/tcomb/stargazers","contributors_url":"https://api.github.com/repos/jgoux/tcomb/contributors","subscribers_url":"https://api.github.com/repos/jgoux/tcomb/subscribers","subscription_url":"https://api.github.com/repos/jgoux/tcomb/subscription","commits_url":"https://api.github.com/repos/jgoux/tcomb/commits{/sha}","git_commits_url":"https://api.github.com/repos/jgoux/tcomb/git/commits{/sha}","comments_url":"https://api.github.com/repos/jgoux/tcomb/comments{/number}","issue_comment_url":"https://api.github.com/repos/jgoux/tcomb/issues/comments{/number}","contents_url":"https://api.github.com/repos/jgoux/tcomb/contents/{+path}","compare_url":"https://api.github.com/repos/jgoux/tcomb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jgoux/tcomb/merges","archive_url":"https://api.github.com/repos/jgoux/tcomb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jgoux/tcomb/downloads","issues_url":"https://api.github.com/repos/jgoux/tcomb/issues{/number}","pulls_url":"https://api.github.com/repos/jgoux/tcomb/pulls{/number}","milestones_url":"https://api.github.com/repos/jgoux/tcomb/milestones{/number}","notifications_url":"https://api.github.com/repos/jgoux/tcomb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jgoux/tcomb/labels{/name}","releases_url":"https://api.github.com/repos/jgoux/tcomb/releases{/id}","created_at":"2015-08-28T06:18:32Z","updated_at":"2015-08-28T06:18:32Z","pushed_at":"2015-08-28T07:11:24Z","git_url":"git://github.com/jgoux/tcomb.git","ssh_url":"git@github.com:jgoux/tcomb.git","clone_url":"https://github.com/jgoux/tcomb.git","svn_url":"https://github.com/jgoux/tcomb","homepage":"https://gcanti.github.io/tcomb","size":1796,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gcanti:master","ref":"master","sha":"121079fc5aaed845bea427485b216e25f551328f","user":{"login":"gcanti","id":878912,"avatar_url":"https://avatars.githubusercontent.com/u/878912?v=3","gravatar_id":"","url":"https://api.github.com/users/gcanti","html_url":"https://github.com/gcanti","followers_url":"https://api.github.com/users/gcanti/followers","following_url":"https://api.github.com/users/gcanti/following{/other_user}","gists_url":"https://api.github.com/users/gcanti/gists{/gist_id}","starred_url":"https://api.github.com/users/gcanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcanti/subscriptions","organizations_url":"https://api.github.com/users/gcanti/orgs","repos_url":"https://api.github.com/users/gcanti/repos","events_url":"https://api.github.com/users/gcanti/events{/privacy}","received_events_url":"https://api.github.com/users/gcanti/received_events","type":"User","site_admin":false},"repo":{"id":21159390,"name":"tcomb","full_name":"gcanti/tcomb","owner":{"login":"gcanti","id":878912,"avatar_url":"https://avatars.githubusercontent.com/u/878912?v=3","gravatar_id":"","url":"https://api.github.com/users/gcanti","html_url":"https://github.com/gcanti","followers_url":"https://api.github.com/users/gcanti/followers","following_url":"https://api.github.com/users/gcanti/following{/other_user}","gists_url":"https://api.github.com/users/gcanti/gists{/gist_id}","starred_url":"https://api.github.com/users/gcanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcanti/subscriptions","organizations_url":"https://api.github.com/users/gcanti/orgs","repos_url":"https://api.github.com/users/gcanti/repos","events_url":"https://api.github.com/users/gcanti/events{/privacy}","received_events_url":"https://api.github.com/users/gcanti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gcanti/tcomb","description":"Type checking and DDD for JavaScript","fork":false,"url":"https://api.github.com/repos/gcanti/tcomb","forks_url":"https://api.github.com/repos/gcanti/tcomb/forks","keys_url":"https://api.github.com/repos/gcanti/tcomb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gcanti/tcomb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gcanti/tcomb/teams","hooks_url":"https://api.github.com/repos/gcanti/tcomb/hooks","issue_events_url":"https://api.github.com/repos/gcanti/tcomb/issues/events{/number}","events_url":"https://api.github.com/repos/gcanti/tcomb/events","assignees_url":"https://api.github.com/repos/gcanti/tcomb/assignees{/user}","branches_url":"https://api.github.com/repos/gcanti/tcomb/branches{/branch}","tags_url":"https://api.github.com/repos/gcanti/tcomb/tags","blobs_url":"https://api.github.com/repos/gcanti/tcomb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gcanti/tcomb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gcanti/tcomb/git/refs{/sha}","trees_url":"https://api.github.com/repos/gcanti/tcomb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gcanti/tcomb/statuses/{sha}","languages_url":"https://api.github.com/repos/gcanti/tcomb/languages","stargazers_url":"https://api.github.com/repos/gcanti/tcomb/stargazers","contributors_url":"https://api.github.com/repos/gcanti/tcomb/contributors","subscribers_url":"https://api.github.com/repos/gcanti/tcomb/subscribers","subscription_url":"https://api.github.com/repos/gcanti/tcomb/subscription","commits_url":"https://api.github.com/repos/gcanti/tcomb/commits{/sha}","git_commits_url":"https://api.github.com/repos/gcanti/tcomb/git/commits{/sha}","comments_url":"https://api.github.com/repos/gcanti/tcomb/comments{/number}","issue_comment_url":"https://api.github.com/repos/gcanti/tcomb/issues/comments{/number}","contents_url":"https://api.github.com/repos/gcanti/tcomb/contents/{+path}","compare_url":"https://api.github.com/repos/gcanti/tcomb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gcanti/tcomb/merges","archive_url":"https://api.github.com/repos/gcanti/tcomb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gcanti/tcomb/downloads","issues_url":"https://api.github.com/repos/gcanti/tcomb/issues{/number}","pulls_url":"https://api.github.com/repos/gcanti/tcomb/pulls{/number}","milestones_url":"https://api.github.com/repos/gcanti/tcomb/milestones{/number}","notifications_url":"https://api.github.com/repos/gcanti/tcomb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gcanti/tcomb/labels{/name}","releases_url":"https://api.github.com/repos/gcanti/tcomb/releases{/id}","created_at":"2014-06-24T09:32:26Z","updated_at":"2015-08-27T09:38:31Z","pushed_at":"2015-08-28T07:15:52Z","git_url":"git://github.com/gcanti/tcomb.git","ssh_url":"git@github.com:gcanti/tcomb.git","clone_url":"https://github.com/gcanti/tcomb.git","svn_url":"https://github.com/gcanti/tcomb","homepage":"https://gcanti.github.io/tcomb","size":1796,"stargazers_count":453,"watchers_count":453,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":4,"forks":22,"open_issues":4,"watchers":453,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gcanti/tcomb/pulls/128"},"html":{"href":"https://github.com/gcanti/tcomb/pull/128"},"issue":{"href":"https://api.github.com/repos/gcanti/tcomb/issues/128"},"comments":{"href":"https://api.github.com/repos/gcanti/tcomb/issues/128/comments"},"review_comments":{"href":"https://api.github.com/repos/gcanti/tcomb/pulls/128/comments"},"review_comment":{"href":"https://api.github.com/repos/gcanti/tcomb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gcanti/tcomb/pulls/128/commits"},"statuses":{"href":"https://api.github.com/repos/gcanti/tcomb/statuses/adaa1676258c2e22688dfbcaf050aa1cfdbdfd41"}}}}