{"action":"created","comment":{"url":"https://api.github.com/repos/scala/scala/pulls/comments/190830106","pull_request_review_id":123290871,"id":190830106,"diff_hunk":"@@ -158,31 +158,30 @@ private[internal] trait GlbLubs {\n         rest filter (t => !first.typeSymbol.isSubClass(t.typeSymbol)))\n   }\n \n+  /** From a list of types, retain only maximal types as determined by the partial order `po`. */\n+  private def maxTypes(ts: List[Type])(po: (Type, Type) => Boolean): List[Type] = {\n+    def loop(ts: List[Type]): List[Type] = ts match {\n+      case t :: ts1 =>\n+        val ts2 = loop(ts1.filterNot(po(_, t)))\n+        if (ts2.exists(po(t, _))) ts2 else t :: ts2\n+      case Nil => Nil","path":"src/reflect/scala/reflect/internal/tpe/GlbLubs.scala","position":10,"original_position":10,"commit_id":"6bbef4e3fd3a19260a68fe9b9431e5cb7a6684e1","original_commit_id":"8c9c70d6a7ac916dc4dcc4391e9124eaec105b34","user":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars2.githubusercontent.com/u/91083?v=4","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false},"body":"I assume we special-cased `Nil` and the singleton list based on profiling before? Before we drop these cases, let's gather some statistics on the frequency with which they occur (from casual inspection, not all callers ensure the list's length is >= 2).","created_at":"2018-05-25T08:51:35Z","updated_at":"2018-05-25T08:51:35Z","html_url":"https://github.com/scala/scala/pull/6257#discussion_r190830106","pull_request_url":"https://api.github.com/repos/scala/scala/pulls/6257","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/scala/scala/pulls/comments/190830106"},"html":{"href":"https://github.com/scala/scala/pull/6257#discussion_r190830106"},"pull_request":{"href":"https://api.github.com/repos/scala/scala/pulls/6257"}}},"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/6257","id":162011899,"html_url":"https://github.com/scala/scala/pull/6257","diff_url":"https://github.com/scala/scala/pull/6257.diff","patch_url":"https://github.com/scala/scala/pull/6257.patch","issue_url":"https://api.github.com/repos/scala/scala/issues/6257","number":6257,"state":"open","locked":false,"title":"Eliminate TypeVars and Wildcards early in glb/lub","user":{"login":"joroKr21","id":2218841,"avatar_url":"https://avatars0.githubusercontent.com/u/2218841?v=4","gravatar_id":"","url":"https://api.github.com/users/joroKr21","html_url":"https://github.com/joroKr21","followers_url":"https://api.github.com/users/joroKr21/followers","following_url":"https://api.github.com/users/joroKr21/following{/other_user}","gists_url":"https://api.github.com/users/joroKr21/gists{/gist_id}","starred_url":"https://api.github.com/users/joroKr21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joroKr21/subscriptions","organizations_url":"https://api.github.com/users/joroKr21/orgs","repos_url":"https://api.github.com/users/joroKr21/repos","events_url":"https://api.github.com/users/joroKr21/events{/privacy}","received_events_url":"https://api.github.com/users/joroKr21/received_events","type":"User","site_admin":false},"body":"Type variables and wildcards can act both as subtypes and\r\nsupertypes depending on the direction of the test. This means\r\ntypes with variables and/or wildcards can shadow other types in\r\n`glb/lub`.\r\n\r\nConsider the following examples:\r\n```scala\r\nlub((Int, ? ) :: (Int, String) :: Nil)\r\nglb((Int, ?A) :: (Int, String) :: Nil)\r\n```\r\n\r\nIntuitively both should return `(Int, String)`, but this depends\r\non the order of types in the list passed to `glb/lub`.\r\nThis commit incorporates the simple heuristic of moving types that\r\ncontain variables and/or wildcards to the end of the list.\r\n\r\nFixes scala/bug#10686 and fixes scala/bug#10740","created_at":"2018-01-10T00:45:57Z","updated_at":"2018-05-25T08:51:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd8f46e5bacd3838dbb5fcfd79de911642050903","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/74","html_url":"https://github.com/scala/scala/milestone/74","labels_url":"https://api.github.com/repos/scala/scala/milestones/74/labels","id":3295287,"number":74,"title":"2.13.0-M5","description":"Merge to 2.13.x. Last milestone. Think of it as RC0. We're in feature freeze after this release.","creator":{"login":"lrytz","id":119636,"avatar_url":"https://avatars1.githubusercontent.com/u/119636?v=4","gravatar_id":"","url":"https://api.github.com/users/lrytz","html_url":"https://github.com/lrytz","followers_url":"https://api.github.com/users/lrytz/followers","following_url":"https://api.github.com/users/lrytz/following{/other_user}","gists_url":"https://api.github.com/users/lrytz/gists{/gist_id}","starred_url":"https://api.github.com/users/lrytz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrytz/subscriptions","organizations_url":"https://api.github.com/users/lrytz/orgs","repos_url":"https://api.github.com/users/lrytz/repos","events_url":"https://api.github.com/users/lrytz/events{/privacy}","received_events_url":"https://api.github.com/users/lrytz/received_events","type":"User","site_admin":false},"open_issues":81,"closed_issues":34,"state":"open","created_at":"2018-04-25T07:15:17Z","updated_at":"2018-05-25T08:17:42Z","due_on":"2018-08-10T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/scala/scala/pulls/6257/commits","review_comments_url":"https://api.github.com/repos/scala/scala/pulls/6257/comments","review_comment_url":"https://api.github.com/repos/scala/scala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala/scala/issues/6257/comments","statuses_url":"https://api.github.com/repos/scala/scala/statuses/6bbef4e3fd3a19260a68fe9b9431e5cb7a6684e1","head":{"label":"joroKr21:solve-wildcards","ref":"solve-wildcards","sha":"6bbef4e3fd3a19260a68fe9b9431e5cb7a6684e1","user":{"login":"joroKr21","id":2218841,"avatar_url":"https://avatars0.githubusercontent.com/u/2218841?v=4","gravatar_id":"","url":"https://api.github.com/users/joroKr21","html_url":"https://github.com/joroKr21","followers_url":"https://api.github.com/users/joroKr21/followers","following_url":"https://api.github.com/users/joroKr21/following{/other_user}","gists_url":"https://api.github.com/users/joroKr21/gists{/gist_id}","starred_url":"https://api.github.com/users/joroKr21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joroKr21/subscriptions","organizations_url":"https://api.github.com/users/joroKr21/orgs","repos_url":"https://api.github.com/users/joroKr21/repos","events_url":"https://api.github.com/users/joroKr21/events{/privacy}","received_events_url":"https://api.github.com/users/joroKr21/received_events","type":"User","site_admin":false},"repo":{"id":106529104,"name":"scala","full_name":"joroKr21/scala","owner":{"login":"joroKr21","id":2218841,"avatar_url":"https://avatars0.githubusercontent.com/u/2218841?v=4","gravatar_id":"","url":"https://api.github.com/users/joroKr21","html_url":"https://github.com/joroKr21","followers_url":"https://api.github.com/users/joroKr21/followers","following_url":"https://api.github.com/users/joroKr21/following{/other_user}","gists_url":"https://api.github.com/users/joroKr21/gists{/gist_id}","starred_url":"https://api.github.com/users/joroKr21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joroKr21/subscriptions","organizations_url":"https://api.github.com/users/joroKr21/orgs","repos_url":"https://api.github.com/users/joroKr21/repos","events_url":"https://api.github.com/users/joroKr21/events{/privacy}","received_events_url":"https://api.github.com/users/joroKr21/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joroKr21/scala","description":"The Scala programming language","fork":true,"url":"https://api.github.com/repos/joroKr21/scala","forks_url":"https://api.github.com/repos/joroKr21/scala/forks","keys_url":"https://api.github.com/repos/joroKr21/scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joroKr21/scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joroKr21/scala/teams","hooks_url":"https://api.github.com/repos/joroKr21/scala/hooks","issue_events_url":"https://api.github.com/repos/joroKr21/scala/issues/events{/number}","events_url":"https://api.github.com/repos/joroKr21/scala/events","assignees_url":"https://api.github.com/repos/joroKr21/scala/assignees{/user}","branches_url":"https://api.github.com/repos/joroKr21/scala/branches{/branch}","tags_url":"https://api.github.com/repos/joroKr21/scala/tags","blobs_url":"https://api.github.com/repos/joroKr21/scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joroKr21/scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joroKr21/scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/joroKr21/scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joroKr21/scala/statuses/{sha}","languages_url":"https://api.github.com/repos/joroKr21/scala/languages","stargazers_url":"https://api.github.com/repos/joroKr21/scala/stargazers","contributors_url":"https://api.github.com/repos/joroKr21/scala/contributors","subscribers_url":"https://api.github.com/repos/joroKr21/scala/subscribers","subscription_url":"https://api.github.com/repos/joroKr21/scala/subscription","commits_url":"https://api.github.com/repos/joroKr21/scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/joroKr21/scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/joroKr21/scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/joroKr21/scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/joroKr21/scala/contents/{+path}","compare_url":"https://api.github.com/repos/joroKr21/scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joroKr21/scala/merges","archive_url":"https://api.github.com/repos/joroKr21/scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joroKr21/scala/downloads","issues_url":"https://api.github.com/repos/joroKr21/scala/issues{/number}","pulls_url":"https://api.github.com/repos/joroKr21/scala/pulls{/number}","milestones_url":"https://api.github.com/repos/joroKr21/scala/milestones{/number}","notifications_url":"https://api.github.com/repos/joroKr21/scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joroKr21/scala/labels{/name}","releases_url":"https://api.github.com/repos/joroKr21/scala/releases{/id}","deployments_url":"https://api.github.com/repos/joroKr21/scala/deployments","created_at":"2017-10-11T08:48:39Z","updated_at":"2018-05-19T21:31:09Z","pushed_at":"2018-05-24T12:45:15Z","git_url":"git://github.com/joroKr21/scala.git","ssh_url":"git@github.com:joroKr21/scala.git","clone_url":"https://github.com/joroKr21/scala.git","svn_url":"https://github.com/joroKr21/scala","homepage":"http://www.scala-lang.org/","size":97206,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"2.12.x"}},"base":{"label":"scala:2.13.x","ref":"2.13.x","sha":"e1d421667be8bc73ed0241fe7a24b36b162c51bd","user":{"login":"scala","id":57059,"avatar_url":"https://avatars2.githubusercontent.com/u/57059?v=4","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"repo":{"id":2888818,"name":"scala","full_name":"scala/scala","owner":{"login":"scala","id":57059,"avatar_url":"https://avatars2.githubusercontent.com/u/57059?v=4","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala/scala","description":"The Scala programming language","fork":false,"url":"https://api.github.com/repos/scala/scala","forks_url":"https://api.github.com/repos/scala/scala/forks","keys_url":"https://api.github.com/repos/scala/scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala/scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala/scala/teams","hooks_url":"https://api.github.com/repos/scala/scala/hooks","issue_events_url":"https://api.github.com/repos/scala/scala/issues/events{/number}","events_url":"https://api.github.com/repos/scala/scala/events","assignees_url":"https://api.github.com/repos/scala/scala/assignees{/user}","branches_url":"https://api.github.com/repos/scala/scala/branches{/branch}","tags_url":"https://api.github.com/repos/scala/scala/tags","blobs_url":"https://api.github.com/repos/scala/scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala/scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala/scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala/scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala/scala/statuses/{sha}","languages_url":"https://api.github.com/repos/scala/scala/languages","stargazers_url":"https://api.github.com/repos/scala/scala/stargazers","contributors_url":"https://api.github.com/repos/scala/scala/contributors","subscribers_url":"https://api.github.com/repos/scala/scala/subscribers","subscription_url":"https://api.github.com/repos/scala/scala/subscription","commits_url":"https://api.github.com/repos/scala/scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala/scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala/scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala/scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala/scala/contents/{+path}","compare_url":"https://api.github.com/repos/scala/scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala/scala/merges","archive_url":"https://api.github.com/repos/scala/scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala/scala/downloads","issues_url":"https://api.github.com/repos/scala/scala/issues{/number}","pulls_url":"https://api.github.com/repos/scala/scala/pulls{/number}","milestones_url":"https://api.github.com/repos/scala/scala/milestones{/number}","notifications_url":"https://api.github.com/repos/scala/scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala/scala/labels{/name}","releases_url":"https://api.github.com/repos/scala/scala/releases{/id}","deployments_url":"https://api.github.com/repos/scala/scala/deployments","created_at":"2011-12-01T05:02:34Z","updated_at":"2018-05-25T08:17:58Z","pushed_at":"2018-05-25T08:17:43Z","git_url":"git://github.com/scala/scala.git","ssh_url":"git@github.com:scala/scala.git","clone_url":"https://github.com/scala/scala.git","svn_url":"https://github.com/scala/scala","homepage":"http://www.scala-lang.org/","size":97317,"stargazers_count":10236,"watchers_count":10236,"language":"Scala","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2429,"mirror_url":null,"archived":false,"open_issues_count":129,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":2429,"open_issues":129,"watchers":10236,"default_branch":"2.13.x"}},"_links":{"self":{"href":"https://api.github.com/repos/scala/scala/pulls/6257"},"html":{"href":"https://github.com/scala/scala/pull/6257"},"issue":{"href":"https://api.github.com/repos/scala/scala/issues/6257"},"comments":{"href":"https://api.github.com/repos/scala/scala/issues/6257/comments"},"review_comments":{"href":"https://api.github.com/repos/scala/scala/pulls/6257/comments"},"review_comment":{"href":"https://api.github.com/repos/scala/scala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala/scala/pulls/6257/commits"},"statuses":{"href":"https://api.github.com/repos/scala/scala/statuses/6bbef4e3fd3a19260a68fe9b9431e5cb7a6684e1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"adriaanm"}}