You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using a decorator on an overloaded function where the decorator uses Concatenate causes false positive "Overloaded function implementation does not accept all possible arguments" error #17459
fromtypingimportCallable, Concatenate, TypeVar, overload, ParamSpecT=TypeVar("T")
P=ParamSpec("P")
R=TypeVar("R")
deffoo(fn: Callable[Concatenate[T, P], R]) ->Callable[Concatenate[T, P], R]:
returnfnclassFoo:
@overloaddefbar(self, a: str) ->str: ...
@overloaddefbar(self, a: int) ->int: ...
# error: Overloaded function implementation does not accept all possible arguments of signature 1# error: Overloaded function implementation does not accept all possible arguments of signature 2@foodefbar(self, a: object) ->object: ...