File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -2719,6 +2719,7 @@ def check_overload_call(
27192719 # for example, when we have a fallback alternative that accepts an unrestricted
27202720 # typevar. See https://github.com/python/mypy/issues/4063 for related discussion.
27212721 erased_targets : list [CallableType ] | None = None
2722+ inferred_types : list [Type ] | None = None
27222723 unioned_result : tuple [Type , Type ] | None = None
27232724
27242725 # Determine whether we need to encourage union math. This should be generally safe,
@@ -2780,9 +2781,10 @@ def check_overload_call(
27802781 else :
27812782 inferred_result = None
27822783 if unioned_result is not None :
2783- for inferred_type in inferred_types :
2784- if isinstance (c := get_proper_type (inferred_type ), CallableType ):
2785- self .chk .warn_deprecated (c .definition , context )
2784+ if inferred_types is not None :
2785+ for inferred_type in inferred_types :
2786+ if isinstance (c := get_proper_type (inferred_type ), CallableType ):
2787+ self .chk .warn_deprecated (c .definition , context )
27862788 return unioned_result
27872789 if inferred_result is not None :
27882790 if isinstance (c := get_proper_type (inferred_result [1 ]), CallableType ):
You can’t perform that action at this time.
0 commit comments