pyright icon indicating copy to clipboard operation
pyright copied to clipboard

False negative when passing an arbitrary value to a function that takes an argument of type `T`

Open LeeeeT opened this issue 10 months ago • 0 comments

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 avatar Apr 17 '24 16:04 LeeeeT