{"action":"opened","number":728,"pull_request":{"url":"https://api.github.com/repos/circe/circe/pulls/728","id":136637699,"html_url":"https://github.com/circe/circe/pull/728","diff_url":"https://github.com/circe/circe/pull/728.diff","patch_url":"https://github.com/circe/circe/pull/728.patch","issue_url":"https://api.github.com/repos/circe/circe/issues/728","number":728,"state":"open","locked":false,"title":"avoid confusion of Int => T with IndexedSeq[T] under -Yparital-unification","user":{"login":"rkrzewski","id":671159,"avatar_url":"https://avatars1.githubusercontent.com/u/671159?v=4","gravatar_id":"","url":"https://api.github.com/users/rkrzewski","html_url":"https://github.com/rkrzewski","followers_url":"https://api.github.com/users/rkrzewski/followers","following_url":"https://api.github.com/users/rkrzewski/following{/other_user}","gists_url":"https://api.github.com/users/rkrzewski/gists{/gist_id}","starred_url":"https://api.github.com/users/rkrzewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkrzewski/subscriptions","organizations_url":"https://api.github.com/users/rkrzewski/orgs","repos_url":"https://api.github.com/users/rkrzewski/repos","events_url":"https://api.github.com/users/rkrzewski/events{/privacy}","received_events_url":"https://api.github.com/users/rkrzewski/received_events","type":"User","site_admin":false},"body":"I did further investigation of test failures related to `-Ypartial-unification` discovered in #724. Here are my findings:\r\n\r\n1) Summoning the partial `Decoder` directly yields nonsensical result while summoning an `Exported[Decoder[...]]` yields correct result because `importedDecoder` is located in `LowerPriorityDecoder`, so `decodeCanBuildFrom` implicit has higher priority.\r\n\r\n2) `decodeCanBuildFrom` is tried because under `-Ypartial-unification` `Int => Qux[String]` is partially unapplied as `[T]Int => T` to fit into `C[_]` shape of second parameter to `def decodeCanBuildFrom[A, C[_]]`.\r\n\r\n3) `decodeCanBuildFrom` succeeds because an instance of `CanBuildFrom[Nothing, Qux[String], Int => Qux[String]]` exists. The instance, as it usually happens, is helpfully provided by `scala.Predef`: `implicit def fallbackStringCanBuildFrom[T]: CanBuildFrom[String, T, immutable.IndexedSeq[T]]`. `CanBuildFrom` has variance of `[-,-,+]` so the types align nicely.\r\n\r\nThis means that the problem is limited to partial decoders with `Int` typed hole, but it's also means it's easy to remedy by adding a constraint on `decodeCanBuildFrom` parameter to ensure it actually a collection, not an `Int => _`. I've used `Traversable`, which in turn required adding separate case for `Array` that is not a `Traversable` but needs a `CanBuildFrom` to handle.\r\n\r\nThis patch does not turn on `-Ypartial-unification`, but I've verified that all the tests pass with and without this option on Scala 2.11 and 2.12","created_at":"2017-08-20T10:06:32Z","updated_at":"2017-08-20T10:06:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/circe/circe/pulls/728/commits","review_comments_url":"https://api.github.com/repos/circe/circe/pulls/728/comments","review_comment_url":"https://api.github.com/repos/circe/circe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/circe/circe/issues/728/comments","statuses_url":"https://api.github.com/repos/circe/circe/statuses/691e7471dae3b2b1625ac971b5990cd9f7b06581","head":{"label":"rkrzewski:partial-unification","ref":"partial-unification","sha":"691e7471dae3b2b1625ac971b5990cd9f7b06581","user":{"login":"rkrzewski","id":671159,"avatar_url":"https://avatars1.githubusercontent.com/u/671159?v=4","gravatar_id":"","url":"https://api.github.com/users/rkrzewski","html_url":"https://github.com/rkrzewski","followers_url":"https://api.github.com/users/rkrzewski/followers","following_url":"https://api.github.com/users/rkrzewski/following{/other_user}","gists_url":"https://api.github.com/users/rkrzewski/gists{/gist_id}","starred_url":"https://api.github.com/users/rkrzewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkrzewski/subscriptions","organizations_url":"https://api.github.com/users/rkrzewski/orgs","repos_url":"https://api.github.com/users/rkrzewski/repos","events_url":"https://api.github.com/users/rkrzewski/events{/privacy}","received_events_url":"https://api.github.com/users/rkrzewski/received_events","type":"User","site_admin":false},"repo":{"id":100852809,"name":"circe","full_name":"rkrzewski/circe","owner":{"login":"rkrzewski","id":671159,"avatar_url":"https://avatars1.githubusercontent.com/u/671159?v=4","gravatar_id":"","url":"https://api.github.com/users/rkrzewski","html_url":"https://github.com/rkrzewski","followers_url":"https://api.github.com/users/rkrzewski/followers","following_url":"https://api.github.com/users/rkrzewski/following{/other_user}","gists_url":"https://api.github.com/users/rkrzewski/gists{/gist_id}","starred_url":"https://api.github.com/users/rkrzewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkrzewski/subscriptions","organizations_url":"https://api.github.com/users/rkrzewski/orgs","repos_url":"https://api.github.com/users/rkrzewski/repos","events_url":"https://api.github.com/users/rkrzewski/events{/privacy}","received_events_url":"https://api.github.com/users/rkrzewski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rkrzewski/circe","description":"Yet another JSON library for Scala","fork":true,"url":"https://api.github.com/repos/rkrzewski/circe","forks_url":"https://api.github.com/repos/rkrzewski/circe/forks","keys_url":"https://api.github.com/repos/rkrzewski/circe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rkrzewski/circe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rkrzewski/circe/teams","hooks_url":"https://api.github.com/repos/rkrzewski/circe/hooks","issue_events_url":"https://api.github.com/repos/rkrzewski/circe/issues/events{/number}","events_url":"https://api.github.com/repos/rkrzewski/circe/events","assignees_url":"https://api.github.com/repos/rkrzewski/circe/assignees{/user}","branches_url":"https://api.github.com/repos/rkrzewski/circe/branches{/branch}","tags_url":"https://api.github.com/repos/rkrzewski/circe/tags","blobs_url":"https://api.github.com/repos/rkrzewski/circe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rkrzewski/circe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rkrzewski/circe/git/refs{/sha}","trees_url":"https://api.github.com/repos/rkrzewski/circe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rkrzewski/circe/statuses/{sha}","languages_url":"https://api.github.com/repos/rkrzewski/circe/languages","stargazers_url":"https://api.github.com/repos/rkrzewski/circe/stargazers","contributors_url":"https://api.github.com/repos/rkrzewski/circe/contributors","subscribers_url":"https://api.github.com/repos/rkrzewski/circe/subscribers","subscription_url":"https://api.github.com/repos/rkrzewski/circe/subscription","commits_url":"https://api.github.com/repos/rkrzewski/circe/commits{/sha}","git_commits_url":"https://api.github.com/repos/rkrzewski/circe/git/commits{/sha}","comments_url":"https://api.github.com/repos/rkrzewski/circe/comments{/number}","issue_comment_url":"https://api.github.com/repos/rkrzewski/circe/issues/comments{/number}","contents_url":"https://api.github.com/repos/rkrzewski/circe/contents/{+path}","compare_url":"https://api.github.com/repos/rkrzewski/circe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rkrzewski/circe/merges","archive_url":"https://api.github.com/repos/rkrzewski/circe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rkrzewski/circe/downloads","issues_url":"https://api.github.com/repos/rkrzewski/circe/issues{/number}","pulls_url":"https://api.github.com/repos/rkrzewski/circe/pulls{/number}","milestones_url":"https://api.github.com/repos/rkrzewski/circe/milestones{/number}","notifications_url":"https://api.github.com/repos/rkrzewski/circe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rkrzewski/circe/labels{/name}","releases_url":"https://api.github.com/repos/rkrzewski/circe/releases{/id}","deployments_url":"https://api.github.com/repos/rkrzewski/circe/deployments","created_at":"2017-08-20T10:02:24Z","updated_at":"2017-08-20T10:02:26Z","pushed_at":"2017-08-20T10:05:22Z","git_url":"git://github.com/rkrzewski/circe.git","ssh_url":"git@github.com:rkrzewski/circe.git","clone_url":"https://github.com/rkrzewski/circe.git","svn_url":"https://github.com/rkrzewski/circe","homepage":"https://circe.github.io/circe/","size":6183,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"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":"circe:master","ref":"master","sha":"48e53abbd11fda0578a53ee0c7956215d3f545bf","user":{"login":"circe","id":23644473,"avatar_url":"https://avatars0.githubusercontent.com/u/23644473?v=4","gravatar_id":"","url":"https://api.github.com/users/circe","html_url":"https://github.com/circe","followers_url":"https://api.github.com/users/circe/followers","following_url":"https://api.github.com/users/circe/following{/other_user}","gists_url":"https://api.github.com/users/circe/gists{/gist_id}","starred_url":"https://api.github.com/users/circe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/circe/subscriptions","organizations_url":"https://api.github.com/users/circe/orgs","repos_url":"https://api.github.com/users/circe/repos","events_url":"https://api.github.com/users/circe/events{/privacy}","received_events_url":"https://api.github.com/users/circe/received_events","type":"Organization","site_admin":false},"repo":{"id":40011080,"name":"circe","full_name":"circe/circe","owner":{"login":"circe","id":23644473,"avatar_url":"https://avatars0.githubusercontent.com/u/23644473?v=4","gravatar_id":"","url":"https://api.github.com/users/circe","html_url":"https://github.com/circe","followers_url":"https://api.github.com/users/circe/followers","following_url":"https://api.github.com/users/circe/following{/other_user}","gists_url":"https://api.github.com/users/circe/gists{/gist_id}","starred_url":"https://api.github.com/users/circe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/circe/subscriptions","organizations_url":"https://api.github.com/users/circe/orgs","repos_url":"https://api.github.com/users/circe/repos","events_url":"https://api.github.com/users/circe/events{/privacy}","received_events_url":"https://api.github.com/users/circe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/circe/circe","description":"Yet another JSON library for Scala","fork":false,"url":"https://api.github.com/repos/circe/circe","forks_url":"https://api.github.com/repos/circe/circe/forks","keys_url":"https://api.github.com/repos/circe/circe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/circe/circe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/circe/circe/teams","hooks_url":"https://api.github.com/repos/circe/circe/hooks","issue_events_url":"https://api.github.com/repos/circe/circe/issues/events{/number}","events_url":"https://api.github.com/repos/circe/circe/events","assignees_url":"https://api.github.com/repos/circe/circe/assignees{/user}","branches_url":"https://api.github.com/repos/circe/circe/branches{/branch}","tags_url":"https://api.github.com/repos/circe/circe/tags","blobs_url":"https://api.github.com/repos/circe/circe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/circe/circe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/circe/circe/git/refs{/sha}","trees_url":"https://api.github.com/repos/circe/circe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/circe/circe/statuses/{sha}","languages_url":"https://api.github.com/repos/circe/circe/languages","stargazers_url":"https://api.github.com/repos/circe/circe/stargazers","contributors_url":"https://api.github.com/repos/circe/circe/contributors","subscribers_url":"https://api.github.com/repos/circe/circe/subscribers","subscription_url":"https://api.github.com/repos/circe/circe/subscription","commits_url":"https://api.github.com/repos/circe/circe/commits{/sha}","git_commits_url":"https://api.github.com/repos/circe/circe/git/commits{/sha}","comments_url":"https://api.github.com/repos/circe/circe/comments{/number}","issue_comment_url":"https://api.github.com/repos/circe/circe/issues/comments{/number}","contents_url":"https://api.github.com/repos/circe/circe/contents/{+path}","compare_url":"https://api.github.com/repos/circe/circe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/circe/circe/merges","archive_url":"https://api.github.com/repos/circe/circe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/circe/circe/downloads","issues_url":"https://api.github.com/repos/circe/circe/issues{/number}","pulls_url":"https://api.github.com/repos/circe/circe/pulls{/number}","milestones_url":"https://api.github.com/repos/circe/circe/milestones{/number}","notifications_url":"https://api.github.com/repos/circe/circe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/circe/circe/labels{/name}","releases_url":"https://api.github.com/repos/circe/circe/releases{/id}","deployments_url":"https://api.github.com/repos/circe/circe/deployments","created_at":"2015-07-31T15:12:09Z","updated_at":"2017-08-20T08:56:42Z","pushed_at":"2017-08-16T17:35:44Z","git_url":"git://github.com/circe/circe.git","ssh_url":"git@github.com:circe/circe.git","clone_url":"https://github.com/circe/circe.git","svn_url":"https://github.com/circe/circe","homepage":"https://circe.github.io/circe/","size":6183,"stargazers_count":984,"watchers_count":984,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":182,"mirror_url":null,"open_issues_count":83,"forks":182,"open_issues":83,"watchers":984,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/circe/circe/pulls/728"},"html":{"href":"https://github.com/circe/circe/pull/728"},"issue":{"href":"https://api.github.com/repos/circe/circe/issues/728"},"comments":{"href":"https://api.github.com/repos/circe/circe/issues/728/comments"},"review_comments":{"href":"https://api.github.com/repos/circe/circe/pulls/728/comments"},"review_comment":{"href":"https://api.github.com/repos/circe/circe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/circe/circe/pulls/728/commits"},"statuses":{"href":"https://api.github.com/repos/circe/circe/statuses/691e7471dae3b2b1625ac971b5990cd9f7b06581"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":11,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"rkrzewski"}}