Closed
Description
I haven't been able to find another issue for this, weird that this hasn't been reported already.
from typing import *
from functools import partial
def inc(a:int) -> int:
return a+1
def foo(f: Callable[[], int]) -> int:
return f()
foo(partial(inc, 1))
This will fail with
error: Argument 1 to "foo" has incompatible type partial[int]; expected Callable[[], int]
a similar code by using a dyadic add
instead of inc
will yield:
error: Argument 1 to "foo" has incompatible type partial[int]; expected Callable[[int], int]
(so, partial apparently doesn't currently retain any type information on the non-applied inputs... I guess this'll make the fix non trivial)