Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive of function conformance #2370

Closed
Azureblade3808 opened this issue Feb 11, 2022 · 3 comments
Closed

False positive of function conformance #2370

Azureblade3808 opened this issue Feb 11, 2022 · 3 comments
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@Azureblade3808
Copy link

Environment data

  • Language Server version: 2022.2.2-pre.1
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.12 Anaconda

Sample code

from __future__ import annotations

from typing import Any, Protocol

class P(Protocol):
    def __call__(self, *args: Any, kwarg0: Any, kwarg1: Any) -> None:
        ...

def f(*args: Any, kwarg0: Any, kwarg1: Any) -> None:
    ...

p: P = f

Expected behavior

No errors / warnings.

Actual behavior

image

Additional notes

To trigger this issue, there should be both variable-length arguments (*args) and more than one keyword argument.

This issue affects both callable protocol and overloading.

@erictraut
Copy link
Contributor

Thanks, I agree this is a bug in the type checker. I've created a tracking bug in the pyright issue tracker.

@erictraut
Copy link
Contributor

This will be fixed in the next release.

@erictraut erictraut added bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed triage labels Feb 11, 2022
@debonte
Copy link
Contributor

debonte commented Feb 17, 2022

This issue has been fixed in version 2022.2.3, which we've just released. You can find the changelog here: CHANGELOG.md

@debonte debonte closed this as completed Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

3 participants