{"action":"created","comment":{"url":"https://api.github.com/repos/python/mypy/pulls/comments/197732918","pull_request_review_id":131531538,"id":197732918,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzczMjkxOA==","diff_hunk":"@@ -451,43 +469,36 @@ def check_overlapping_overloads(self, defn: OverloadedFuncDef) -> None:\n                             self.msg.overloaded_signatures_overlap(\n                                 i + 1, i + j + 2, item.func)\n \n-            if defn.impl:\n-                if isinstance(defn.impl, FuncDef):\n-                    impl_type = defn.impl.type\n-                elif isinstance(defn.impl, Decorator):\n-                    impl_type = defn.impl.var.type\n-                else:\n-                    assert False, \"Impl isn't the right type\"\n+            if impl_type is not None:\n+                assert defn.impl is not None\n \n-                # This can happen if we've got an overload with a different\n-                # decorator too -- we gave up on the types.\n-                if impl_type is None or isinstance(impl_type, AnyType):\n-                    return\n-                assert isinstance(impl_type, CallableType)\n+                # We perform a unification step that's very similar to what\n+                # 'is_callable_compatible' would have done if we had set\n+                # 'unify_generics' to True -- the only difference is that\n+                # we check and see if the impl_type's return value is a\n+                # *supertype* of the overload alternative, not a *subtype*.\n+                #\n+                # This is to match the direction the implementation's return\n+                # needs to be compatible in.\n+                if impl_type.variables:\n+                    impl = unify_generic_callable(impl_type, sig1,\n+                                                  ignore_return=False,\n+                                                  return_constraint_direction=SUPERTYPE_OF)\n+                    if impl is None:\n+                        self.msg.overloaded_signatures_typevar_specific(i + 1, defn.impl)\n+                        continue\n+                else:\n+                    impl = impl_type\n \n                 # Is the overload alternative's arguments subtypes of the implementation's?\n-                if not is_callable_compatible(impl_type, sig1,\n+                if not is_callable_compatible(impl, sig1,\n                                               is_compat=is_subtype,\n-                                              ignore_return=True):\n+                                              ignore_return=True,\n+                                              unify_generics=False):","path":"mypy/checker.py","position":75,"original_position":75,"commit_id":"2d604fa9dec8d3a4924feef0d35fbc402f652301","original_commit_id":"2d604fa9dec8d3a4924feef0d35fbc402f652301","user":{"login":"ilevkivskyi","id":12005495,"node_id":"MDQ6VXNlcjEyMDA1NDk1","avatar_url":"https://avatars1.githubusercontent.com/u/12005495?v=4","gravatar_id":"","url":"https://api.github.com/users/ilevkivskyi","html_url":"https://github.com/ilevkivskyi","followers_url":"https://api.github.com/users/ilevkivskyi/followers","following_url":"https://api.github.com/users/ilevkivskyi/following{/other_user}","gists_url":"https://api.github.com/users/ilevkivskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/ilevkivskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilevkivskyi/subscriptions","organizations_url":"https://api.github.com/users/ilevkivskyi/orgs","repos_url":"https://api.github.com/users/ilevkivskyi/repos","events_url":"https://api.github.com/users/ilevkivskyi/events{/privacy}","received_events_url":"https://api.github.com/users/ilevkivskyi/received_events","type":"User","site_admin":false},"body":"This function has already too many arguments. Is there a way to avoid `unify_generics`? Like if you already unified above, the unification in `is_callable_compatible` will be a no-op?","created_at":"2018-06-25T09:30:28Z","updated_at":"2018-06-25T09:33:48Z","html_url":"https://github.com/python/mypy/pull/5236#discussion_r197732918","pull_request_url":"https://api.github.com/repos/python/mypy/pulls/5236","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/python/mypy/pulls/comments/197732918"},"html":{"href":"https://github.com/python/mypy/pull/5236#discussion_r197732918"},"pull_request":{"href":"https://api.github.com/repos/python/mypy/pulls/5236"}}},"pull_request":{"url":"https://api.github.com/repos/python/mypy/pulls/5236","id":195704572,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1NzA0NTcy","html_url":"https://github.com/python/mypy/pull/5236","diff_url":"https://github.com/python/mypy/pull/5236.diff","patch_url":"https://github.com/python/mypy/pull/5236.patch","issue_url":"https://api.github.com/repos/python/mypy/issues/5236","number":5236,"state":"open","locked":false,"title":"Make overload impl checks correctly handle TypeVars and untyped impls","user":{"login":"Michael0x2a","id":1424628,"node_id":"MDQ6VXNlcjE0MjQ2Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/1424628?v=4","gravatar_id":"","url":"https://api.github.com/users/Michael0x2a","html_url":"https://github.com/Michael0x2a","followers_url":"https://api.github.com/users/Michael0x2a/followers","following_url":"https://api.github.com/users/Michael0x2a/following{/other_user}","gists_url":"https://api.github.com/users/Michael0x2a/gists{/gist_id}","starred_url":"https://api.github.com/users/Michael0x2a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Michael0x2a/subscriptions","organizations_url":"https://api.github.com/users/Michael0x2a/orgs","repos_url":"https://api.github.com/users/Michael0x2a/repos","events_url":"https://api.github.com/users/Michael0x2a/events{/privacy}","received_events_url":"https://api.github.com/users/Michael0x2a/received_events","type":"User","site_admin":false},"body":"This pull request fixes https://github.com/python/mypy/issues/4619 as well as an unrelated bug where if the overload implementation was untyped, we only check to see if there are unsafe overlaps between the *first* overload alternative and the rest.","created_at":"2018-06-19T03:45:16Z","updated_at":"2018-06-25T09:33:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9397e8368323ce10b969f4d0a66563970d9dcbb0","assignee":{"login":"ilevkivskyi","id":12005495,"node_id":"MDQ6VXNlcjEyMDA1NDk1","avatar_url":"https://avatars1.githubusercontent.com/u/12005495?v=4","gravatar_id":"","url":"https://api.github.com/users/ilevkivskyi","html_url":"https://github.com/ilevkivskyi","followers_url":"https://api.github.com/users/ilevkivskyi/followers","following_url":"https://api.github.com/users/ilevkivskyi/following{/other_user}","gists_url":"https://api.github.com/users/ilevkivskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/ilevkivskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilevkivskyi/subscriptions","organizations_url":"https://api.github.com/users/ilevkivskyi/orgs","repos_url":"https://api.github.com/users/ilevkivskyi/repos","events_url":"https://api.github.com/users/ilevkivskyi/events{/privacy}","received_events_url":"https://api.github.com/users/ilevkivskyi/received_events","type":"User","site_admin":false},"assignees":[{"login":"ilevkivskyi","id":12005495,"node_id":"MDQ6VXNlcjEyMDA1NDk1","avatar_url":"https://avatars1.githubusercontent.com/u/12005495?v=4","gravatar_id":"","url":"https://api.github.com/users/ilevkivskyi","html_url":"https://github.com/ilevkivskyi","followers_url":"https://api.github.com/users/ilevkivskyi/followers","following_url":"https://api.github.com/users/ilevkivskyi/following{/other_user}","gists_url":"https://api.github.com/users/ilevkivskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/ilevkivskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilevkivskyi/subscriptions","organizations_url":"https://api.github.com/users/ilevkivskyi/orgs","repos_url":"https://api.github.com/users/ilevkivskyi/repos","events_url":"https://api.github.com/users/ilevkivskyi/events{/privacy}","received_events_url":"https://api.github.com/users/ilevkivskyi/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/python/mypy/pulls/5236/commits","review_comments_url":"https://api.github.com/repos/python/mypy/pulls/5236/comments","review_comment_url":"https://api.github.com/repos/python/mypy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python/mypy/issues/5236/comments","statuses_url":"https://api.github.com/repos/python/mypy/statuses/2d604fa9dec8d3a4924feef0d35fbc402f652301","head":{"label":"Michael0x2a:fix-overloads-impl-checks","ref":"fix-overloads-impl-checks","sha":"2d604fa9dec8d3a4924feef0d35fbc402f652301","user":{"login":"Michael0x2a","id":1424628,"node_id":"MDQ6VXNlcjE0MjQ2Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/1424628?v=4","gravatar_id":"","url":"https://api.github.com/users/Michael0x2a","html_url":"https://github.com/Michael0x2a","followers_url":"https://api.github.com/users/Michael0x2a/followers","following_url":"https://api.github.com/users/Michael0x2a/following{/other_user}","gists_url":"https://api.github.com/users/Michael0x2a/gists{/gist_id}","starred_url":"https://api.github.com/users/Michael0x2a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Michael0x2a/subscriptions","organizations_url":"https://api.github.com/users/Michael0x2a/orgs","repos_url":"https://api.github.com/users/Michael0x2a/repos","events_url":"https://api.github.com/users/Michael0x2a/events{/privacy}","received_events_url":"https://api.github.com/users/Michael0x2a/received_events","type":"User","site_admin":false},"repo":{"id":62247533,"node_id":"MDEwOlJlcG9zaXRvcnk2MjI0NzUzMw==","name":"mypy","full_name":"Michael0x2a/mypy","owner":{"login":"Michael0x2a","id":1424628,"node_id":"MDQ6VXNlcjE0MjQ2Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/1424628?v=4","gravatar_id":"","url":"https://api.github.com/users/Michael0x2a","html_url":"https://github.com/Michael0x2a","followers_url":"https://api.github.com/users/Michael0x2a/followers","following_url":"https://api.github.com/users/Michael0x2a/following{/other_user}","gists_url":"https://api.github.com/users/Michael0x2a/gists{/gist_id}","starred_url":"https://api.github.com/users/Michael0x2a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Michael0x2a/subscriptions","organizations_url":"https://api.github.com/users/Michael0x2a/orgs","repos_url":"https://api.github.com/users/Michael0x2a/repos","events_url":"https://api.github.com/users/Michael0x2a/events{/privacy}","received_events_url":"https://api.github.com/users/Michael0x2a/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Michael0x2a/mypy","description":"Optional static typing for Python 2 and 3 (PEP484)","fork":true,"url":"https://api.github.com/repos/Michael0x2a/mypy","forks_url":"https://api.github.com/repos/Michael0x2a/mypy/forks","keys_url":"https://api.github.com/repos/Michael0x2a/mypy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Michael0x2a/mypy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Michael0x2a/mypy/teams","hooks_url":"https://api.github.com/repos/Michael0x2a/mypy/hooks","issue_events_url":"https://api.github.com/repos/Michael0x2a/mypy/issues/events{/number}","events_url":"https://api.github.com/repos/Michael0x2a/mypy/events","assignees_url":"https://api.github.com/repos/Michael0x2a/mypy/assignees{/user}","branches_url":"https://api.github.com/repos/Michael0x2a/mypy/branches{/branch}","tags_url":"https://api.github.com/repos/Michael0x2a/mypy/tags","blobs_url":"https://api.github.com/repos/Michael0x2a/mypy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Michael0x2a/mypy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Michael0x2a/mypy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Michael0x2a/mypy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Michael0x2a/mypy/statuses/{sha}","languages_url":"https://api.github.com/repos/Michael0x2a/mypy/languages","stargazers_url":"https://api.github.com/repos/Michael0x2a/mypy/stargazers","contributors_url":"https://api.github.com/repos/Michael0x2a/mypy/contributors","subscribers_url":"https://api.github.com/repos/Michael0x2a/mypy/subscribers","subscription_url":"https://api.github.com/repos/Michael0x2a/mypy/subscription","commits_url":"https://api.github.com/repos/Michael0x2a/mypy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Michael0x2a/mypy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Michael0x2a/mypy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Michael0x2a/mypy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Michael0x2a/mypy/contents/{+path}","compare_url":"https://api.github.com/repos/Michael0x2a/mypy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Michael0x2a/mypy/merges","archive_url":"https://api.github.com/repos/Michael0x2a/mypy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Michael0x2a/mypy/downloads","issues_url":"https://api.github.com/repos/Michael0x2a/mypy/issues{/number}","pulls_url":"https://api.github.com/repos/Michael0x2a/mypy/pulls{/number}","milestones_url":"https://api.github.com/repos/Michael0x2a/mypy/milestones{/number}","notifications_url":"https://api.github.com/repos/Michael0x2a/mypy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Michael0x2a/mypy/labels{/name}","releases_url":"https://api.github.com/repos/Michael0x2a/mypy/releases{/id}","deployments_url":"https://api.github.com/repos/Michael0x2a/mypy/deployments","created_at":"2016-06-29T18:12:20Z","updated_at":"2018-06-21T20:05:00Z","pushed_at":"2018-06-21T23:13:54Z","git_url":"git://github.com/Michael0x2a/mypy.git","ssh_url":"git@github.com:Michael0x2a/mypy.git","clone_url":"https://github.com/Michael0x2a/mypy.git","svn_url":"https://github.com/Michael0x2a/mypy","homepage":"http://www.mypy-lang.org/","size":26735,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"python:master","ref":"master","sha":"a55635dcf30d329f43c589f111a22b39694ecdde","user":{"login":"python","id":1525981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjU5ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1525981?v=4","gravatar_id":"","url":"https://api.github.com/users/python","html_url":"https://github.com/python","followers_url":"https://api.github.com/users/python/followers","following_url":"https://api.github.com/users/python/following{/other_user}","gists_url":"https://api.github.com/users/python/gists{/gist_id}","starred_url":"https://api.github.com/users/python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python/subscriptions","organizations_url":"https://api.github.com/users/python/orgs","repos_url":"https://api.github.com/users/python/repos","events_url":"https://api.github.com/users/python/events{/privacy}","received_events_url":"https://api.github.com/users/python/received_events","type":"Organization","site_admin":false},"repo":{"id":7053637,"node_id":"MDEwOlJlcG9zaXRvcnk3MDUzNjM3","name":"mypy","full_name":"python/mypy","owner":{"login":"python","id":1525981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjU5ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1525981?v=4","gravatar_id":"","url":"https://api.github.com/users/python","html_url":"https://github.com/python","followers_url":"https://api.github.com/users/python/followers","following_url":"https://api.github.com/users/python/following{/other_user}","gists_url":"https://api.github.com/users/python/gists{/gist_id}","starred_url":"https://api.github.com/users/python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python/subscriptions","organizations_url":"https://api.github.com/users/python/orgs","repos_url":"https://api.github.com/users/python/repos","events_url":"https://api.github.com/users/python/events{/privacy}","received_events_url":"https://api.github.com/users/python/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python/mypy","description":"Optional static typing for Python 2 and 3 (PEP484)","fork":false,"url":"https://api.github.com/repos/python/mypy","forks_url":"https://api.github.com/repos/python/mypy/forks","keys_url":"https://api.github.com/repos/python/mypy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python/mypy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python/mypy/teams","hooks_url":"https://api.github.com/repos/python/mypy/hooks","issue_events_url":"https://api.github.com/repos/python/mypy/issues/events{/number}","events_url":"https://api.github.com/repos/python/mypy/events","assignees_url":"https://api.github.com/repos/python/mypy/assignees{/user}","branches_url":"https://api.github.com/repos/python/mypy/branches{/branch}","tags_url":"https://api.github.com/repos/python/mypy/tags","blobs_url":"https://api.github.com/repos/python/mypy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python/mypy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python/mypy/git/refs{/sha}","trees_url":"https://api.github.com/repos/python/mypy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python/mypy/statuses/{sha}","languages_url":"https://api.github.com/repos/python/mypy/languages","stargazers_url":"https://api.github.com/repos/python/mypy/stargazers","contributors_url":"https://api.github.com/repos/python/mypy/contributors","subscribers_url":"https://api.github.com/repos/python/mypy/subscribers","subscription_url":"https://api.github.com/repos/python/mypy/subscription","commits_url":"https://api.github.com/repos/python/mypy/commits{/sha}","git_commits_url":"https://api.github.com/repos/python/mypy/git/commits{/sha}","comments_url":"https://api.github.com/repos/python/mypy/comments{/number}","issue_comment_url":"https://api.github.com/repos/python/mypy/issues/comments{/number}","contents_url":"https://api.github.com/repos/python/mypy/contents/{+path}","compare_url":"https://api.github.com/repos/python/mypy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python/mypy/merges","archive_url":"https://api.github.com/repos/python/mypy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python/mypy/downloads","issues_url":"https://api.github.com/repos/python/mypy/issues{/number}","pulls_url":"https://api.github.com/repos/python/mypy/pulls{/number}","milestones_url":"https://api.github.com/repos/python/mypy/milestones{/number}","notifications_url":"https://api.github.com/repos/python/mypy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python/mypy/labels{/name}","releases_url":"https://api.github.com/repos/python/mypy/releases{/id}","deployments_url":"https://api.github.com/repos/python/mypy/deployments","created_at":"2012-12-07T13:30:23Z","updated_at":"2018-06-25T08:28:18Z","pushed_at":"2018-06-25T08:03:05Z","git_url":"git://github.com/python/mypy.git","ssh_url":"git@github.com:python/mypy.git","clone_url":"https://github.com/python/mypy.git","svn_url":"https://github.com/python/mypy","homepage":"http://www.mypy-lang.org/","size":26671,"stargazers_count":4107,"watchers_count":4107,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":552,"mirror_url":null,"archived":false,"open_issues_count":855,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":552,"open_issues":855,"watchers":4107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python/mypy/pulls/5236"},"html":{"href":"https://github.com/python/mypy/pull/5236"},"issue":{"href":"https://api.github.com/repos/python/mypy/issues/5236"},"comments":{"href":"https://api.github.com/repos/python/mypy/issues/5236/comments"},"review_comments":{"href":"https://api.github.com/repos/python/mypy/pulls/5236/comments"},"review_comment":{"href":"https://api.github.com/repos/python/mypy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python/mypy/pulls/5236/commits"},"statuses":{"href":"https://api.github.com/repos/python/mypy/statuses/2d604fa9dec8d3a4924feef0d35fbc402f652301"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ilevkivskyi"}}