Closed
Description
This fragment generates a false positive, starting from #15913:
from typing import overload, Any
class C:
@overload
def f(self, e: str, **kwargs) -> str: ...
@overload
# error: Overloaded function signature 2 will never be matched: signature 1's
# parameter type(s) are the same or broader
def f(self, *args, **kwargs) -> Any: ...
def f(self, *args, **kwargs):
pass
The signature of item 2 is wider than item 1 due to accepting an arbitrary number of positional arguments and with arbitrary types, so this is a false positive.
cc @ilevkivskyi