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 negative when passing an arbitrary value to a function that takes an argument of type T #7718

Closed
LeeeeT opened this issue Apr 17, 2024 · 1 comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working

Comments

@LeeeeT
Copy link

LeeeeT commented Apr 17, 2024

Pyright should produce an error for the following code, as object cannot be assigned to T@f.

from collections.abc import Callable

def f[T](v: object, c: Callable[[], Callable[[T], object]]) -> None:
    c()(v)
@LeeeeT LeeeeT added the bug Something isn't working label Apr 17, 2024
erictraut added a commit that referenced this issue May 21, 2024
…tion that returns a callable with a generic parameter type. This addresses #7718.
erictraut added a commit that referenced this issue May 21, 2024
…tion that returns a callable with a generic parameter type. This addresses #7718. (#7965)
@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label May 21, 2024
@erictraut
Copy link
Collaborator

This is addressed in pyright 1.1.364.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants