from typing import overload
class A:
@property
def t2(self) -> int:
return 2
@t2.setter
@overload
def t2(self, value: None) -> None:
...
@t2.setter
@overload
def t2(self, value: int) -> None:
...
@t2.setter
def t2(self, value: int | None) -> None:
...
a = A()
a.t2 = None
main.py:24:0: Cannot call overloaded function [incompatible_call]
In overload (self, value: None) -> None
In call to main.A.t2: Missing required argument 'value'
In overload (self, value: int) -> None
In call to main.A.t2: Missing required argument 'value'
This should be allowed.
Also, if one of the overloads is deprecated, we should report the deprecation.
This should be allowed.
Also, if one of the overloads is deprecated, we should report the deprecation.