Open
Description
from typing import Callable, Concatenate, TypeVar, overload, ParamSpec
T = TypeVar("T")
P = ParamSpec("P")
R = TypeVar("R")
def foo(fn: Callable[Concatenate[T, P], R]) -> Callable[Concatenate[T, P], R]:
return fn
class Foo:
@overload
def bar(self, a: str) -> str: ...
@overload
def bar(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
@foo
def bar(self, a: object) -> object: ...