File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -1482,7 +1482,7 @@ def check_call_expr_with_callee_type(
14821482 object_type = object_type ,
14831483 )
14841484 proper_callee = get_proper_type (callee_type )
1485- if isinstance (e .callee , NameExpr ):
1485+ if isinstance (e .callee , ( NameExpr , MemberExpr ) ):
14861486 self .chk .warn_deprecated_overload_item (e .callee .node , e , target = callee_type )
14871487 if isinstance (e .callee , RefExpr ) and isinstance (proper_callee , CallableType ):
14881488 # Cache it for find_isinstance_check()
Original file line number Diff line number Diff line change @@ -595,3 +595,26 @@ h(1.0) # E: No overload variant of "h" matches argument type "float" \
595595 # N: def h(x: str) -> str
596596
597597[builtins fixtures/tuple.pyi]
598+
599+
600+ [case testDeprecatedImportedOverloadedFunction]
601+
602+ import m
603+
604+ m.g
605+ m.g(1) # N: overload def (x: builtins.int) -> builtins.int of function m.g is deprecated: work with str instead
606+ m.g("x")
607+
608+ [file m.py]
609+
610+ from typing import Union
611+ from typing_extensions import deprecated, overload
612+
613+ @overload
614+ @deprecated("work with str instead")
615+ def g(x: int) -> int: ...
616+ @overload
617+ def g(x: str) -> str: ...
618+ def g(x: Union[int, str]) -> Union[int, str]: ...
619+
620+ [builtins fixtures/tuple.pyi]
You can’t perform that action at this time.
0 commit comments