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 reportNoOverloadImplementation after passing function through generics #9803

Open
Alan-Chen99 opened this issue Feb 2, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Alan-Chen99
Copy link

from typing import Generic, TypeVar

T = TypeVar("T")


class cast(Generic[T]):
    def __init__(self, _: T):
        pass

    def __call__(self, a) -> T:
        return a


@cast(print)
def print(  # error: "print" is marked as overload, but no implementation is provided (reportNoOverloadImplementation)
    *args, **kwargs
):
    assert False


# workaround
def wrap(x: T) -> T:
    assert False


print = wrap(print)
pyright --version
pyright 1.1.393
@Alan-Chen99 Alan-Chen99 added the bug Something isn't working label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant